Make a website https://golangci-lint.run
for golangci-lint documentation.
The website is backed by Gatsby static site generator
and deployed into Netlify.
Run CI on mac os only with go1.13 and on windows only on go1.14.
Speed up tests. Introduce --allow-parallel-runners.
Block on parallel run lock 5s instead of 60s.
Don't invalidate analysis cache for minor config changes.
* Update to latest x/tools (2020/01/19).
Fixes#893
* Initialize vet analyzers as unexportd global vars.
Fixes#915
* Support testing Go 1.14beta1.
* ci: reset go.mod and go.sum before generated diff check
* Update to latest x/tools (2020/02/04)
Co-authored-by: Aleksandr Razumov <ar@gortc.io>
Run all linters per package. It allows unloading package data when it's
processed. It dramatically reduces memory (and CPU because of GC) usage.
Relates: #337
* update staticcheck
Don't fork staticcheck: use the upstream version.
Remove unneeded SSA loading.
* Cache go/analysis facts
Don't load unneeded packages for go/analysis.
Repeated run of go/analysis linters now 10x faster
(2s vs 20s on this repo) than before.
Significantly improve CPU and memory usage when not using SSA-powered linters.
Improve readability of go/packages errors.
Improve debugging capabilities and write doc about debugging.
This mostly aims to document how everything was generated, and the steps
necessary to re-generate the same files verbatim; the goal is to figure
out how to reproduce the files as they currently are. The exception is
that we strip out the timestamp out of install.sh.
kata-containers's ci will re-build and re-install golangci-lint every
time it did the staic check.
So run test of golangci-lint with build will make it slow.
Add target build to make golangci-lint just build but not test.
Fixes: #458
Signed-off-by: Hui Zhu <teawater@hyper.sh>
Fix#324, relates #314
1. Update gocritic to the latest version
2. Use proper gocritic checkers repo, old repo was archived
3. Get enabled by default gocritic checks in sync with go-critic: don't
enable performance, experimental and opinionated checks by default
4. Support of `enabled-tags` options for gocritic
5. Enable almost all gocritic checks for the project
6. Make rich debugging for gocritic
7. Meticulously validate gocritic checks config
1. Rename in a backward compatible way
2. Remove gosec default exclude list because gosec is already disabled
by default.
3. Warn about unmatched linter names in //nolint directives
4. Process linter names in //nolint directives in upper case
5. Disable gosec for golangci-lint in .golangci.yml
1. Allow govet to work in 2 modes: fast and slow. Default is slow.
In fast mode golangci-lint runs `go install -i` and `go test -i`
for analyzed packages. But it's fast only when:
- go >= 1.10
- it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached
between CI builds
In slow mode we load program from source code like for another linters
and do it only once for all linters.
3. Patch govet code to warn about any troubles with the type
information. Default behaviour of govet was to hide such warnings.
Fail analysis if there are any troubles with type loading: it will
prevent false-positives and false-negatives from govet.
4. Describe almost all options in .golangci.example.yml and
include it into README. Describe when to use slow or fast mode of govet.
5. Speed up govet: reuse AST parsing: it's already parsed once by
golangci-lint.
For "slow" runs (when we run at least one slow linter) speedup by
not loading type information second time.
6. Improve logging, debug logging
7. Fix crash in logging of AST cache warnings (#118)
1. Log all warnings, don't hide none of them
2. Write fatal messages (stop analysis) with error log level
3. Remove ugly timestamp counter from logrus output
4. Print nested module prefix in log
5. Make logger abstraction: no global logging anymore
6. Refactor config reading to config.FileReader struct to avoid passing
logger into every function
7. Replace exit codes hardcoding with constants in exitcodes package
8. Fail test if any warning was logged
9. Fix calculation of relative path if we analyze parent dir ../
10. Move Runner initialization from Executor to NewRunner func
11. Log every AST parsing error
12. Properly print used config file path in verbose mode
13. Print package files if only 1 package is analyzedin verbose mode,
print not compiling packages in verbose mode
14. Forbid usage of github.com/sirupsen/logrus by DepGuard linter
15. Add default ignore pattern to folint: "comment on exported const"