Closed brandon-leapyear closed 3 years ago
ORMOLU_DISABLE
is only meant to be used around top-level forms, not selectively around expressions like this. I do not consider this a bug, a feature request perhaps.
The readme says:
Because of that the magic comments cannot be placed arbitrarily, but rather must enclose independent top-level definitions.
:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:
Interesting... I was able to work around this with
asdf :: IO ()
asdf = go
where
{- ORMOLU_DISABLE -}
go = do
x <- foo
return (x,x)
{- ORMOLU_ENABLE -}
foo = pure 1
which works, so perhaps an undocumented feature? But yes, then this issue is a feature request
The feature is a bit of a hack. Surely, it'll accidentally work is some cases, but this usage is not something we officially support.
Describe the bug Adding a
ORMOLU_DISABLE
/ORMOLU_ENABLE
block before awhere
clause cause ormolu to move the block into thewhere
clauseTo Reproduce
Running ormolu on this gives
Same thing happens if the
ORMOLU
comments are not indentedExpected behavior Code should stay the same
Environment
Additional context Add any other context about the problem here.