A transparent proxy for golangci-lint that automatically manages configuration by merging base and local YAML files.
- Consistent configuration across all your Go projects
- Automatic updates of base linting rules without manual intervention
- Local customization while maintaining team standards
- Zero configuration for new projects - just run and it works
- Transparent usage - works exactly like regular golangci-lint
- Copy
golangci-lint.sh
to your desired location (e.g.,/usr/local/bin/
) - Make it executable:
chmod +x golangci-lint.sh
Install the required dependencies:
# macOS
brew install golangci-lint yq curl
# Or via Go
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go install github.com/mikefarah/yq/v4@latest
Use it exactly like golangci-lint
, but with automatic configuration management:
# Basic usage
./golangci-lint.sh run
# With custom local config
./golangci-lint.sh run -c my-config.yml
# With additional flags
./golangci-lint.sh run --fix --verbose
The tool automatically:
- Downloads/updates base configuration from the remote repository
- Looks for local configuration (
.golangci.local.yml
or.golangci.local.yaml
) - Merges them into
.golangci.generated.yml
- Runs golangci-lint with the merged configuration
Create .golangci.local.yml
in your project to customize settings:
linters:
enable:
- gosec
disable:
- gofmt
issues:
exclude-rules:
- path: _test\.go
linters:
- gosec
GOLANGCI_FORCE_UPDATE=1
- Force update base configurationGOLANGCI_SKIP_UPDATE=1
- Skip configuration update
Remove cache and generated files:
./golangci-lint.sh --cleanup
./golangci-lint.sh --help