* add ability to set issue severity for out formats that support it based on severity rules
* fix lint issues
* change log child name
* code climate omit severity if empty
* add tests for severity rules, add support for case sensitive rules, fix lint issues, better doc comments, share processor test
* deduplicated rule logic into a base rule that can be used by multiple rule types, moved severity config to it's own parent key named severity, reduced size of NewRunner function to make it easier to read
* put validate function under base rule struct
* better validation error wording
* add Fingerprint and Description methods to Issue struct, made codeclimate reporter easier to read, checkstyle output is now pretty printed
Ensure that `unused` is always the last
in execution order. It can speed up packages loading
a bit.
Refactor enabled linters set to remove extra logging.
Relates: #944
The function assumed, previously, that issue.Line always equals
issue.LineRange.From. But this needn't be true, and the code needn't
assume it. Now we actually replace the specified line-range.
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
Don't perform extra go env calls in go/packages.
Load only needed go env vars in golangci-lint.
Stay in sync by enabled analyzers in go vet: remove nilness and
atomicalign analyzers, add errorsas analyzer.
Don't build SSA for govet.
Standalone govet runs 25% faster than before. All runs can be 5-10% faster
than before.
Relates: #208
Treat Go source files as plain text files by misspell: it allows detecting
issues in strings, variable names, etc. Also, it's the default mode of
a standalone misspell tool.
Also, implement richer and more stable auto-fix of misspell issues:
now it can fix multiple issues in one line.
Preprocessed files like .qtpl.go quicktemplate Go files can have
//line directives. They map to a source .qtpl file.
This commit fixes linting of such files:
1. don't fail on AST cache loading
2. output Go filename not .qtpl or similar
Also, here we update golint to the upstream version.
Relates: #316, #466, #467, #468
Also do following improvements:
- show proper sublinter name for megacheck sublinters
- refactor and make more simple and robust megacheck
merging/optimizing
- improve handling of unknown linter names in //nolint directives
- minimize diff of our megacheck version from the upstream,
https://github.com/golang/go/issues/29612 blocks usage of the upstream
version
- support the new `stylecheck` linter
- improve tests coverage for megacheck and nolint related cases
- update and use upstream versions of unparam and interfacer instead of forked
ones
- don't use golangci/tools repo anymore
- fix newly found issues after updating linters
Also should be noted that megacheck works much faster and consumes less
memory in the newest release, therefore golangci-lint works noticeably
faster and consumes less memory for large repos.
Relates: #314