Use go/packages instead of x/tools/loader: it allows to work
with go modules and speedups loading of packages with the help
of build cache.
A lot of linters became "fast": they are enabled by --fast now and
work in 1-2 seconds. Only unparam, interfacer and megacheck
are "slow" linters now.
Average project is analyzed 20-40% faster than before if all linters are
enabled! If we enable all linters except unparam, interfacer and
megacheck analysis is 10-20x faster!
Motivation: Make it clear that the message is indicating packages
*which do not compile*, rather than packages which *won't be
compiled [for some unknown reason]*.
Should be `max-same-issues`, not `max-same`.
Also adds a trailing newline to files, which is good form, and updates
the generator to handle that cleanly.
Fixes#216.
A recent change was introduced in goimports improving how it sort and
format imports in https://go-review.googlesource.com/c/tools/+/116795
This commit updates the vendored version of the golang.org/x/tools
repository to include these changes.
Add support for the exclude and ignore flags of errcheck.
Note that, this commit depends on golangci/errcheck#1. We need
to merge it first, update vendors and only then merge this one.
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
Although the FAQ does eventually mention that
--new-from-rev=origin/master is the right way, --help does not and
using --new in CI is a terrible pitfall.
Make --help point users to -new-from-rev=HEAD~ for CI setups.
Also use HEAD~ instead of origin/master, since HEAD~ is more
universally applicable, e.g. if golangci-lint is ran against a release
branch.