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

Switch from treefmt -> pre-commit #144

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Switch from treefmt -> pre-commit #144

merged 1 commit into from
Nov 19, 2024

Conversation

srid
Copy link
Owner

@srid srid commented Nov 19, 2024

I feel that the quality of treemt has lately declined. For eg., recent versions started dumping a bunch of needless noise (why is it now trying to format all files in repo?):

image

which then required more configuration in Nix to fix:

d8c7e63

And this unnecessarily extra config will vary across projects, depending on the files they have.


We strictly don't need treefmt though (besides, not everyone is allowed to contribute) because that's what pre-commit run -a is for.

To that end, this PR gets rid of treefmt and switches to https://github.com/cachix/git-hooks.nix (the Nix module for https://pre-commit.com/).

Functionality more or less remains the same - except for losing just formatter (which can be added to git-hooks.nix) and of course gaining git pre-commit hooks setup in devShell.

@srid
Copy link
Owner Author

srid commented Nov 19, 2024

Flake check is added and built on CI:

2024-11-19T00:28:21.3833522Z pre-commit-run> cabal-fmt................................................................Passed
2024-11-19T00:28:21.4654726Z pre-commit-run> fourmolu.................................................................Passed
2024-11-19T00:28:21.8773274Z pre-commit-run> hlint....................................................................Passed
2024-11-19T00:28:21.8875114Z pre-commit-run> nixpkgs-fmt..............................................................Passed

@srid srid marked this pull request as ready for review November 19, 2024 00:37
@srid srid changed the title treefmt -> pre-commit Switch from treefmt -> pre-commit Nov 19, 2024
@srid srid merged commit 85b7437 into master Nov 19, 2024
2 checks passed
@srid srid deleted the git-hooks branch November 19, 2024 01:04
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

Successfully merging this pull request may close these issues.

1 participant