File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,22 +76,24 @@ Fourmolu can be integrated with your editor via the [Haskell Language Server](ht
7676Fourmolu understands two magic comments :
7777
7878` ` ` haskell
79- {- ORMOLU_DISABLE -}
79+ {- FOURMOLU_DISABLE -}
8080` ` `
8181
8282and
8383
8484` ` ` haskell
85- {- ORMOLU_ENABLE -}
85+ {- FOURMOLU_ENABLE -}
8686` ` `
8787
8888This allows us to disable formatting selectively for code between these
8989markers or disable it for the entire file. To achieve the latter, just put
90- ` {- ORMOLU_DISABLE -}` at the very top. Note that the source code should
90+ ` {- FOURMOLU_DISABLE -}` at the very top. Note that the source code should
9191still be parseable even without the “excluded” part. Because of that the
9292magic comments cannot be placed arbitrary, but should rather enclose
9393independent top-level definitions.
9494
95+ ` {- ORMOLU_DISABLE -}` and `{- ORMOLU_ENABLE -}`, respectively, can be used to the same effect.
96+
9597# # Current limitations
9698
9799* CPP support is experimental. CPP is virtually impossible to handle
Original file line number Diff line number Diff line change @@ -127,11 +127,11 @@ disableMarker = "{- ORMOLU_DISABLE -}"
127127
128128-- | Return 'True' if the given string is an enabling marker.
129129isOrmoluEnable :: String -> Bool
130- isOrmoluEnable = magicComment " ORMOLU_ENABLE"
130+ isOrmoluEnable s = magicComment " ORMOLU_ENABLE" s || magicComment " FOURMOLU_ENABLE " s
131131
132132-- | Return 'True' if the given string is a disabling marker.
133133isOrmoluDisable :: String -> Bool
134- isOrmoluDisable = magicComment " ORMOLU_DISABLE"
134+ isOrmoluDisable s = magicComment " ORMOLU_DISABLE" s || magicComment " FOURMOLU_DISABLE " s
135135
136136-- | Construct a function for whitespace-insensitive matching of string.
137137magicComment ::
You can’t perform that action at this time.
0 commit comments