-
Notifications
You must be signed in to change notification settings - Fork 156
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
Set the column-limit
in fourmolu
config
#4175
Conversation
3ec3f18
to
061fd5e
Compare
509e1d3
to
8d477a1
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.
Well... There certainly are some interesting formatting changes but I think they are more or less fine. Except for one instance that I pointed out in the code, that one really is an eyesore.
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.
Looks good to me, very generous explanations!
I'm personally not going to use the pre-commit hook but I will certainly use the --changes
flag with fourmolu, it will be great to not have to wait so long for the script.
The added `.git-blame-ignore-revs` file can be used with `git blame` to ignore certain commits when blaming, which is useful when we want to commit large formatting changes without messing up the output of `git blame`. Also, by adding this file to the repo `GitHub` will pick it up automatically and ignore the listed commits. Usage: `git blame --ignore-revs-file .git-blame-ignore-revs somefile.ext` However, it is highly recommended that you configure `git blame` locally to always ignore the commits specified in `.git-blame-ignore-revs`. You can do this by running the following from the repository's root: `git config blame.ignoreRevsFile .git-blame-ignore-revs`. From then on, you can just run `git blame somefile.ext` and ignoring will also work for git porcelains and integrations automatically.
It does not work well with the `column-limit` rule. See: https://fourmolu.github.io/config/column-limit/
10e1571
to
40059da
Compare
This will make it possible to only run `fourmolu` on changes. When the `--changes` flag is omitted, we default to the old behaviour.
* Explain `pre-commit` setup * Provide some examples
We both run formatting checks as a Hydra job via `pre-commit-check` and as a GitHub action with `fourmolize.sh`. Disable the former for now until we decide settling for one of them.
40059da
to
bf735c3
Compare
Description
In addition to applying the formatting changes enforced by the added
column-limit
rule, this PR will also:fourmolize.sh
as that doesn't play well withcolumn-limit
.See: https://fourmolu.github.io/config/column-limit/
.git-blame-ignore-revs
file so we can keep track of commits with large formatting changes and ignore them when blaming.fourmolize.sh
on changed files only by supplying the--changes
flag.fourmolu
GitHub action on changed files only (compared toorigin/master
).pre-commit
in a non-intrusive way.For now, I disabled running the
pre-commit-check
as a Hydra job until we decide whether to keep the current setup (runningfourmolize.sh
as a GitHub action) or switch topre-commit
. Both options have their advantages, however if at one point we decide to adoptiogx
, I would advocate forpre-commit
via Hydra. Regardless,pre-commit
will be available from now on as agit hook
and one can opt-in to use it conveniently, albeit in a bit hacky way (see theSKIP
flag trick detailed inCONTRIBUTING.md
).Resolves #4069
Checklist
.cabal
andCHANGELOG.md
files according to theversioning process.
.cabal
files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)CHANGELOG.md
for the affected packages. New section is never added with the code changes. (See RELEASING.md)fourmolu
(usescripts/fourmolize.sh
)scripts/cabal-format.sh
)hie.yaml
has been updated (usescripts/gen-hie.sh
)