This change updates the `gosec` linter to its v2 version. It seems like v2
maintained API compatibility for the functionality we use, so we only needed to
update the dependency and imports.
Please note, this does not use a tagged version of `gosec` and instead is the
latest `master` commit due to this issue: https://github.com/securego/gosec/issues/470.
Once this issue is resolved we should update `gosec` to a tagged release.
This also adds a line to the `.gitignore` file, to ignore the `.test` output
files that get generated by `go test`. This could accidentally get left behind,
so no use committing binary files.
Fixes#1052
full diff: https://github.com/dominikh/go-tools/compare/2019.2.3...2020.1.3
Also updates tests to accomodate updated rules:
--- FAIL: TestSourcesFromTestdataWithIssuesDir/staticcheck.go (0.43s)
linters_test.go:137: [run --disable-all --print-issued-lines=false --print-linter-name=false --out-format=line-number --max-same-issues=10 -Estaticcheck --no-config testdata/staticcheck.go]
linters_test.go:33:
Error Trace: linters_test.go:33
linters_test.go:138
linters_test.go:53
Error: Received unexpected error:
staticcheck.go:11: no match for `self-assignment of x to x` vs ["SA4006: this value of `x` is never used"] in:
staticcheck.go:11:2: SA4006: this value of `x` is never used
unmatched errors
staticcheck.go:11:2: SA4006: this value of `x` is never used
Test: TestSourcesFromTestdataWithIssuesDir/staticcheck.go
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* 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>
* Update WSL to v1.2.4
* Fix false positive multiline case
* Fix false positive slice expression
* Fix false positive index expression
* Support to configure/allow cuddle declarations
* Support to configurre/allow case blocks to end with whitespace
* Support cuddle defer http body close
* Re-generate README.md
* Update WSL to v1.2.5
* Support output comments for example functions
* Fix bad field tag for config
* Add WSL linter
* Use v1.0.0 tag for wsl
* Don't add specific test file skip, use mutex to add errors
* Fix goimports error
* Add more tests for WSL, bump WSL version
* Fix bad go.sum (go mod tidy)
* Add gocognit linter
* Remove gocognit to the golangci config
* Make changes on README.md
* Remove gocognit from megacheck benchtest
* Remove command line flags
* Comply with new style
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