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

Add new plugins #243

Open
begriffs opened this issue Apr 24, 2017 · 5 comments
Open

Add new plugins #243

begriffs opened this issue Apr 24, 2017 · 5 comments

Comments

@begriffs
Copy link
Owner

@jship
Copy link
Collaborator

jship commented May 18, 2017

hindent can sort imports and v5.2.3 can sort explicit import lists.

@begriffs
Copy link
Owner Author

What's your opinion of https://github.com/lspitzner/brittany as a replacement for hindent?

@jship
Copy link
Collaborator

jship commented May 20, 2017

brittany is nice but it's novelty shows from some local testing. It choked on some Template Haskell and some tuple sections, even with the relevant ghc options passed in via config.yaml. It also doesn't deal with "data-decls, classes, instances, imports/exports", so hindent is a more batteries-included package right now.

Does seem to have smarter newline wrapping though:

From Hindent:

userResetRequest :: Request
userResetRequest =
  baseRequest & setRequestPath "/ToolNavigation.asp" &
  setRequestBodyURLEncoded
    [ ("FactoryDefaultConfirm", "0")
    , ("RestoreDefaultsNo", "0x00")
    , ("UserResetYes", "0x01")
    ]

From brittany:

userResetRequest :: Request
userResetRequest =
  baseRequest & setRequestPath "/ToolNavigation.asp" & setRequestBodyURLEncoded
    [ ("FactoryDefaultConfirm", "0")
    , ("RestoreDefaultsNo"    , "0x00")
    , ("UserResetYes"         , "0x01")
    ]

The showcase output compared to hindent is more pleasing to me too: https://github.com/lspitzner/brittany/blob/71d7abc00793681fba056040fd38c65c6abb8b94/Showcase.md

brittany uses ghc-exactPrint while hindent uses haskell-src-exts, which in the long run will likely give brittany the upper hand. I don't feel it's ready for prime time yet though.

@begriffs
Copy link
Owner Author

begriffs commented Nov 8, 2017

Brittany is now on Stackage. So if/when we want to switch to it, should be easy to do.

@jship
Copy link
Collaborator

jship commented Nov 9, 2017

Nice! 🎉 Would be good to test out brittany again.

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

No branches or pull requests

2 participants