treefmt-nix currently doesn't support golangci-lint, a popular and comprehensive Go linter. Go developers have to use separate tools or less comprehensive linters.
Proposed Solution
Add programs/golangci-lint.nix with comprehensive configuration options, following patterns from typos.nix and prettier.nix:
enableLinters/disableLinters: Control which linters to run
configFile: Path to custom config file
timeout: Set analysis timeout
concurrency: Configure CPU usage
buildTags: Specify build tags
tests: Control test file analysis
fastOnly: Run only fast linters
Implementation
I can implement this new formatter with:
- Full golangci-lint CLI option support
- Follows established treefmt-nix patterns
- Comprehensive configuration options
- Auto-fixing capabilities (
--fix flag)
This would allow users to configure golangci-lint declaratively:
programs.golangci-lint = {
enable = true;
enableLinters = [ "govet" "errcheck" "staticcheck" ];
timeout = "5m";
tests = false;
};
treefmt-nix currently doesn't support golangci-lint, a popular and comprehensive Go linter. Go developers have to use separate tools or less comprehensive linters.
Proposed Solution
Add
programs/golangci-lint.nixwith comprehensive configuration options, following patterns fromtypos.nixandprettier.nix:enableLinters/disableLinters: Control which linters to runconfigFile: Path to custom config filetimeout: Set analysis timeoutconcurrency: Configure CPU usagebuildTags: Specify build tagstests: Control test file analysisfastOnly: Run only fast lintersImplementation
I can implement this new formatter with:
--fixflag)This would allow users to configure golangci-lint declaratively: