numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
228 stars 68 forks source link

feat(programs): add golangci-lint #134

Closed folliehiyuki closed 9 months ago

folliehiyuki commented 9 months ago

This PR adds golangci-lint as a builtin formatter. It is actually a Go meta-linter, but can be used to fix the incorrect files (if supported by the sub-linters defined by users).

folliehiyuki commented 9 months ago

Thanks again for the detailed suggestion! The change should be okay now :)

folliehiyuki commented 9 months ago

Sorry @zimbatm, as I did not take the below problem into account before this PR was merged!

I think the change doesn't work as intended. golangci-lint requires all the specified files in the argument to be in the same directory to work (or else we need to specify a list of directories instead, recursively or not via <dir>/... syntax).

zimbatm commented 9 months ago

Ah bummer. That won't work with treefmt then! Do you mind sending a PR to remove it?

folliehiyuki commented 9 months ago

I created https://github.com/numtide/treefmt-nix/pull/135 to remove golangci-lint (basically revert this PR). I'll go back to use it in a custom nix flake check :)