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.
lll is using scanner.Scan() to read the file line by line.
scanner.Scan() might fail if the line is longer than bufio.MaxScanTokenSize
In the case where the specified maxLineLen is smaller than bufio.MaxScanTokenSize
we can return this line as a long line instead of returning an error.
The reason for this change is that this case might happen with autogenerated files
The go-bindata tool for instance might generate a file with a very long line.
In this case, as it's a auto generated file, the warning returned by lll will
be ignored.
But if we return a linter error here, and this error happens for an autogenerated
file the error will be discarded (fine), but all the subsequent errors for lll will
be discarded for other files and we'll miss legit error.