Is your bug specific to Fourmolu?
Did you try it on the web app?
Did you search for existing issues?
Describe the bug
Long lines that use BlockArguments cause an error when formatted using a column-limit that is less than the length of the line. I noticed this bug when formatting Hspec tests (e.g. it "foo" do).
A minimal example:
{-# LANGUAGE BlockArguments #-}
putThen :: String -> IO a -> IO a
putThen s action =
putStrLn s >> action
main :: IO ()
main = do
putThen "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" do
putStrLn ""
Results in:
<stdin>
@@ -7,4 +7,5 @@
main :: IO ()
main = do
- putThen "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" do
+ putThen
+ "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" do
putStrLn ""
AST of input and AST of formatted code differ.
at <stdin>:(9,3)-(10,15)
Please, consider reporting the bug.
To format anyway, use --unsafe.
Is your bug specific to Fourmolu?
Did you try it on the web app?
Did you search for existing issues?
Describe the bug
Long lines that use
BlockArgumentscause an error when formatted using acolumn-limitthat is less than the length of the line. I noticed this bug when formatting Hspec tests (e.g.it "foo" do).A minimal example:
{-# LANGUAGE BlockArguments #-} putThen :: String -> IO a -> IO a putThen s action = putStrLn s >> action main :: IO () main = do putThen "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789" do putStrLn ""Results in: