tweag / ormolu

A formatter for Haskell source code
https://ormolu-live.tweag.io
Other
958 stars 83 forks source link

DISABLED ormolu remove empty lines #673

Closed ryukzak closed 3 years ago

ryukzak commented 3 years ago

Describe the bug I expect that ORMOLU_DISABLE can fully disable ormolu, but it continues removing empty lines.

To Reproduce Input file:

{- ORMOLU_DISABLE -}

module Foo (foo,bar) where

foo :: Int -> Int
foo = (+5)

bar :: Bool -> Bool
bar True  = True
bar False = True

Output file:

{- ORMOLU_DISABLE -}

module Foo (foo,bar) where

foo :: Int -> Int
foo = (+5)

bar :: Bool -> Bool
bar True  = True
bar False = True

Expected behavior Output source code should be identical to the input if I put {- ORMOLU_DISABLE -} at a file start.

{- ORMOLU_DISABLE -}

module Foo (foo,bar) where

foo :: Int -> Int
foo = (+5)

bar :: Bool -> Bool
bar True  = True
bar False = True

Environment

brandon-leapyear commented 3 years ago

:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:


Trailing spaces are also removed.

kukimik commented 3 years ago

I expect that ORMOLU_DISABLE can fully disable ormolu, but it continues removing empty lines.

@ryukzak Note that there is an exception regarding the indentation level in the regions where formatting is disabled. See #601.