17 Commits

Author SHA1 Message Date
Denis Isaev
8c1237b667 Use the newest go vet
The newest go vet based on go/analysis
2019-03-17 23:12:44 +03:00
Vitaly Isaev
0fdd91dc3d Update golang.org/x/tools package to fix false IllTyped error 2019-03-17 15:29:58 +03:00
Denis Isaev
b607ea387e #392: run GO111MODULE=on go mod vendor after go-diff update 2019-02-17 18:27:59 +03:00
Denis Isaev
183765e6d4
update gosec
$ git cherry --abbrev -v 8afd9cbb6cfb 66fb7fc33547
+ 63b25c1 Fix typo in README (#235)
+ 419c929 G107 - SSRF (#236)
+ 145f1a0 Removed wrapping feature (#238)
+ ec32ce6 Support Go 1.11 (#239)
+ 762ff3a Allow quoted strings to be used to format SQL queries (#240)
+ 7f6509a Update README.md (#246)
+ 5f98926 Refactor Dockerfile (#245)
+ d3f1980 Fix false positives for SQL string concatenation with constants from another file (#247)
+ 64d58c2 Refactor the test code sample to support multiple files per sample
+ 1ecd47e bump Dockerfile golang from 1.10 to 1.11
+ 027dc2b This fixes the html template when using '-fmt=html'  - resolves HTML escaping issues within the template  - resolves reference issues to reportInfo struct i.e. issues -> Issues, metrics -> Stats
+ 8c09a83 Add install.sh script
+ 97bc137 Add CI Installation steps and correct markdown lint errors
+ 3116b07 Fix typos in comments and rulelist (#256)
+ 443f84f Fix golint link (#263)
+ 4180994 Make G201 ignore CallExpr with no args (#262)
+ 9b966a4 add test case for strings.Builder G104 whitelist inclusion
+ adb4222 whitelist strings.Builder method in rule G104
+ ae82798 Fix the WriteSring test by handling the error
+ 2695567 Build the code sample for string builder only fron Go 1.10 onwards
+ f14f17f Add a helper function which extracts the string parameters values of a call expression
+ 9b32fca Fix the bind rule to handle the case when the arguments of the net.Listen are returned by a function call
+ 24e3094 Extend the bind rule to handle the case when the net.Listen address in provided from a const
+ 72e95e8 Geneate and upload the test coverage report to codecove.io
+ 12400f9 Update README with the code coverage batch
+ 14ed63d Do not flag the unhandled errors which are explicitly ignored
+ f87af5f Detect the unhandled errors even though they are explicitly ignored if the 'audit: enabled' setting is defined in the global configuration (#274)
+ 5d33e6e Update the README with some details about the configuration file
+ b662615 Fix typo
+ a966ff7 Fix -conf example in README.md
+ 04ce7ba add a no-fail flag
+ e2752bc revert to default GOPATH if necessary (#279)
- c04360f make API
+ 66fb7fc Replace import paths
2019-02-11 09:43:23 +03:00
Denis Isaev
b31cfd6c78
update go-critic
$ git cherry --abbrev -v 0af0999fabfb ee9bf5809ead
+ abd8436 all: enable Go modules on CI (#753)
+ 3c9d0fb checkers: recognize //line and //nolint in commentFormatting (#756)
+ 0b517d7 checkers: extend deprecatedComment patterns (#757)
+ 09100f6 checkers: use astcast package instead of coerce.go (#758)
+ 2e9e97f checker: simplify boolExprSimplify (#759)
+ 575701e make: add go-consistent to CI checks list (#761)
+ b55f431 checkers: fix unlambda handling of builtins (#763)
+ 5a7dee3 checker: handle lambdas properly in boolExprSimplify (#765)
+ 5ce3939 checkers: teach boolExprSimplify a few new tricks (#766)
+ 04d160f checkers: add new patterns to boolExprSimplify (#768)
+ 09582e2 make: collect coverprofile separately from goveralls (#769)
+ d8d0ee4 checkers: recognize NOTE pattern in deprecatedComment (#770)
+ 12f0f85 Update copyright notice to 2019 (#771)
+ f54bdb6 checkers: add stringXbytes checker
+ 170d65c checkers: followup for #773 (#774)
+ 84e9e83 checkers: make stringXbytes more linear (#775)
+ a800815 checkers: add Depreacted typo pattern (#776)
+ 6751be9 checkers: add hexLiterals (#772)
+ ac61906 checkers: add typeAssertChain checker (#782)
+ d19dbf1 checkers: add codegenComment checker (#783)
+ d82b576 checkers: proper pkg/obj check for flagName (#786)
+ dfcf754 ci: enable integration tests (#787)
+ 5dafc45 checkers: fix equalFold false positive (#788)
+ ed5e8e7 checkers: refactor and fix hexLiteral checker (#789)
+ e704e07 checkers: add argOrder checker (#790)
+ 34c1dc8 checkers: add Split handling to argOrder checker (#791)
+ cbe095d checkers: add math.Max and math.Min to dupArg (#792)
+ c986ee5 checkers: add checkers info fields test (#794)
+ 66e5832 cmd/makedocs: use lintpack, fix build (#793)
+ 6bce9d0 cmd/makedocs: add enabled/disabled by default info (#795)
+ 4adbf9a checkers: simplify flagName (#799)
+ 07de34a checkers: add octalLiteral checker (#798)
+ 765907a cmd/makedocs: add checker param docs (#796)
+ ee9bf58 cmd/makedocs: fix headers formatting (#803)
2019-02-11 09:35:41 +03:00
Denis Isaev
81cf48771e
Fix #387: update goimports
$ git cherry --abbrev -v d66bd3c5d5a6 379209517ffe | fgrep imports:
+ a06a922a imports: update zstdlib to Go 1.12
+ cb89afad imports: drop anything after a non identifier rune in package
names
2019-02-11 09:11:51 +03:00
Denis Isaev
9916a2fb79
Relates #367: update unparam
$ git cherry -v cc9d2fb52971 fbb59629db34
+ 7362051ae01a0e35956c077c3be5505c70edd200 testdata: add more regression
tests
+ a88ca0234e2c3732a53cd49514fb3877a5d9f1f5 properly record which methods
implement interfaces
+ b762b0b27fa23ebbdfc31df1af4097cfd89a17f6 work properly with method
wrapper functions
+ f59bb08c5c7429b88e0c6e2399b12e71e8d950db testdata: consistently use
tabs
+ 46a5101c55d03117b263b4c5161e5d01353311c1 replace more callgraph code
with plain SSA
+ 1679b9996abdc6431c2147a133e5223ebb86ea60 rewrite foo(bar()) code to
work without callgraph
+ 71b5df77c291f8c5ead5f9ff0a69e0eebf3ae5b2 rewrite "called in return"
code without callgraph
+ fc5b1c74f563d4f2f9ee7d91eda648fc7baebf67 check: replace last use of
callgraph
+ 229ad68a599e2622cf9d3bb87a385b158efe736f fix a minor false negative in
callExtract
+ fbb59629db34a0f69275bc336cc8c3a4dd9fbe5d fix up another false negative
in testdata
2019-02-11 09:02:56 +03:00
Jonathan Chappelow
01fb8231f9 unparam: update unparam, and go mod vendor
This updates the unparam linter to the current version that has fewer
false positives. The go.{mod,sum} files and the vendor folder are
updated as follows:

export GO111MODULE=on
go get -u mvdan.cc/unparam
go mod tidy
go mod vendor

The unparam callgraph algorithm is no longer selectable. Ref:
https://github.com/mvdan/unparam/commit/e6a6d1c5
This is the reason for removing the c.CallgraphAlgorithm(us.Algo) line
from pkg/golinters/unparam.go.
2019-02-11 13:48:53 +08:00
Denis Isaev
af080e7503
don't crash when staticcheck panics 2019-01-24 12:19:05 +03:00
Denis Isaev
87aae77943 Update gocritic
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
2019-01-09 09:51:48 +03:00
Denis Isaev
7705f82591 Update megacheck to the latest version
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
2019-01-08 21:16:15 +03:00
Denis Isaev
609de3254c Fix #331: fix errcheck "ignore" config directive.
Make tests for "ignore" and "exclude" directives.
Mark all hidden command-line options as deprecated.
2018-12-23 12:33:41 +03:00
Denis Isaev
a4a7100011 Fix #263: update goimports
The new version of goimports works 100x faster
with go modules. Also it has some new features:

$ git cherry -v 6c7e314b6563 92cdcd90bf52 | fgrep imports
+ 5bbcdc15656ef390fab5dd6e8daf95354f7171e3 imports: redesign fixImports
+ ee45598d2ff288037f53f9e13ae0b1a6e2165ad5 imports: create named imports for name/path mismatches (again)
+ 4c53570e0460bc32468f75bf9dd71c018d03bfa9 imports: ignore globals in different packages
+ 1d424dbce8dd500e9e449fd3ff9d0668c09e2ae1 imports: clean up customization seam
+ 6a3e9aa2ab7749d72d1006ee484271b4a11f96c2 imports: fix renamed sibling imports
+ 5f4a60f04f23ac48e0665f257413ae3eacf339be imports: fix renamed sibling imports more
+ bbccd8cae4a9a47e0f978e03ff4b5df88a9fde1e imports: use go/packages, support modules
+ d4971274fe382404aee0e8c163af974f2bf738e6 imports: don't remove imports that conflict with globals
2018-12-22 15:50:16 +03:00
David López
37e6995b45 lintpack/gocritic: update lintpack & gocritic versions
update lintpack & gocritic versions to support all the new gocritic checks
2018-12-22 15:34:16 +03:00
Tim Heckman
cb5d1da986 Add support for home directory expansion for -c/--config flag
This change introduces the ability to use the tilde (`~`) character in your
`-c/--config` flag value to expand your home directory. If invoking this via the
command line with `--config ~/.golangci-lint.yaml`, the user's shell expands the
`~` to the home directory. However, if something is invoking the program for
you (like an editor) it may not do the expansion.

Fixes #289

Signed-off-by: Tim Heckman <t@heckman.io>
2018-11-14 14:30:26 +03:00
Denis Isaev
ac77eaac68 Fix #282, fix #209: revert goimports commit
ed64e33c8c8bc9a919e2b85a1a08225b5ae59d70. Also add tests
for local mode of goimports and do refactoring of tests.
2018-11-10 11:46:37 +03:00
Denis Isaev
0935ce1b8d fix #132: support go-critic linter 2018-11-07 09:11:08 +03:00