Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 67fb005

Browse files
authored
fix HackfmtFormatter for HHVM >= 4.49 (#129)
1 parent d86a4e5 commit 67fb005

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/HackfmtFormatter.hack

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ final class HackfmtFormatter implements ICodegenFormatter {
6262
$options[] = '--tabs';
6363
}
6464

65+
// HHVM < 4.48 always formats generated code. HHVM 4.48 never does (so this
66+
// formatter is broken on that version). HHVM >= 4.49 formats generated code
67+
// iff the following flag is provided:
68+
if (\version_compare(\HHVM_VERSION, '4.49') >= 0) {
69+
$options[] = '--format-generated-code';
70+
}
71+
6572
return Vec\map(
6673
$options,
6774
$option ==> \escapeshellarg($option),

0 commit comments

Comments
 (0)