lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
691 stars 72 forks source link

Wandering comment in list-literal/let-in/case-of #297

Open lspitzner opened 4 years ago

lspitzner commented 4 years ago
func =
  [ abc
  , let x = y
    in  case x of
          -- comment
          abc -> def
          ghc -> ghjas
  ]

haven't checked if this is minimal.

hellerve commented 4 years ago

The minimal example that I found is this (based on the example in the online version):

main =
  let x = 42
  in -- here we do something fun
      print x

Every time we run brittany, a space will be inserted between in and the comment. This is a problem for me when using brittany in CI to check (using -c) whether the formatting is okay to go, since it will always output 1.