-
Notifications
You must be signed in to change notification settings - Fork 26
Introduce fourmolu
#1500
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
base: main
Are you sure you want to change the base?
Introduce fourmolu
#1500
Conversation
f02fd29
to
bcd85b6
Compare
8b917de
to
3d236c7
Compare
@@ -0,0 +1,6 @@ | |||
indentation: 2 | |||
column-limit: 100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enforcing a column limit has various idempotency issues. Usually minor, so no need to do sth immediately, but something to keep in mind if it gets too annoying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you rather suggest to reformat the code base and to not enforce the limit? I do not see how we would be able to prevent addition of longer lines in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, what you do in this PR looks good to me, just pointing out this potential downside of column-limit
, but no immediate action required.
...consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Chunks/Internal.hs
Outdated
Show resolved
Hide resolved
- enable ImportQualifiedPost - apply fourmolu code styler to all files
Allows ignoring code reformatting and similar changes
3d236c7
to
1efcc78
Compare
4c93d83
to
03f535a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the final code looks good. Just a minor remark on CONTRIBUTING but overall I am fine with the result.
@@ -203,19 +203,19 @@ and improvements are always welcome. | |||
|
|||
## Formatting the code | |||
|
|||
We use `stylish-haskell` 0.14.6.0 for Haskell code formatting. | |||
We use `fourmolu` 0.17.0.0 for Haskell code formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is 0.18.0.0 in the end.
Fixes #1499
PR description
This PR introduces
fourmolu
as an automatic code formatter to replacestylish-haskell
Beyond the actual reformatting, I've introduced the following changes:
fourmolu
to the Nix shellscripts/ci/run-fourmolu.sh
scripts, which is based on the previously used script forstylish-haskell
fourmolu
(and pushed a dummy commit to check that the CI rejects improperly styled code).git-blame-ignore-revs
and checked that the blame interface on GitHub respects itfourmolu
.Additionally, I've enabled
ImportQualifiedPost
in all cabal files, alongside with the-Wprepositive-qualified-module
warning. This extension and warning could be removed once (if?) we transition toGHC2021
as the default language.