Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brittany fails to format code with Haddock comments in module export list #365

Open
vaclavsvejcar opened this issue Jan 17, 2022 · 2 comments
Labels

Comments

@vaclavsvejcar
Copy link

Most recent version of Brittany from master (0aa04af) fails when Haddock comments are present in list of exported declarations. Here is the example to replicate:

module Example
  ( -- * Brittany doesn't like this comment
    foo
  ) where

foo :: String
foo = "hello"

Output:

Error: Command failed: /Users/vaclav/.local/bin/brittany Example.hs --write-mode display
Error: detected unprocessed comments. The transformation output will most likely not contain some of the comments present in the input haskell source file.
Affected are the following comments:
(Comment "-- * Brittany doesn't like this comment" Example.hs:2:5-43 Nothing)
(Comment "-- * Brittany doesn't like this comment" Example.hs:2:5-43 Nothing)

Until now I was using quite old version (built from 434854f) and that works fine.

@tfausak tfausak added the bug label Jan 17, 2022
@vaclavsvejcar
Copy link
Author

@tfausak Do you have any idea if there's any workaround for this? Usually it makes brittany unusable for any code containing comments in export list. Or if you could point me (at least approximately) into part of brittany codebase that could be responsible for this, I could try to find the issue (comparing with older version where it worked, etc). I'm happy to help, it's just super difficult for me to get into brittany codebase, mainly due to ghc-exactprint, for which I cannot find any reasonable introduction or documentation.

@tfausak
Copy link
Collaborator

tfausak commented Feb 28, 2022

Sorry, I do not have a workaround for this.

I don't know where exactly to look for this behavior. It certainly changed as part of #357, but lots of things changed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants