473 Commits

Author SHA1 Message Date
Isaev Denis
f1c1dbfab4
Feature/enable autofix on whitespace (#674)
The whitespace linter was added in #673. Enable it and fix found issues.
Add auto-fixing to the whitespace linter.
2019-09-10 16:56:44 +03:00
NiseVoid
c7dee2c0b2 Add whitespace linter (#673) 2019-09-10 13:25:01 +03:00
Denis Isaev
31afdf8b04
dev: build by go1.13 for release v1.18.0 2019-09-10 12:14:24 +03:00
Denis Isaev
5fb91e6434
docs: document bash completion in README
Also, change command `golangci-lint completion`
  to `golangci-lint completion bash`.
2019-09-10 12:06:10 +03:00
Christoph Blecker
91e90eba6b Add support for bash completions (#640) 2019-09-10 11:30:02 +03:00
Fei Xu
4ed1349a6b add kubeedge (#636) 2019-09-10 11:25:26 +03:00
Glen Mailer
97fcafd38c Update format of junit xml output to mark failures as such (#632) 2019-09-10 11:21:08 +03:00
Denis Isaev
bad04bb737
dev: regenerate README.md after #630
Also, output help for the new option in a more compact way.
2019-09-10 11:17:18 +03:00
Sean DuBois
f312a0fc4e fix #416: Add skip-dirs-use-default (#630) 2019-09-10 11:14:25 +03:00
Isaev Denis
c87c37210f
dev: update install.sh (#672) 2019-09-10 11:09:39 +03:00
Denis Isaev
95d5b2c071
dev: fix golang.org/x/tools revision date
Use git log --pretty=fuller to distinguish between
AuthorDate and CommitDate. Use CommitDate for go.mod.
2019-09-10 11:02:54 +03:00
Denis Isaev
e691e606b1
dev: fix updated golangci/tools revision 2019-09-10 10:59:34 +03:00
Denis Isaev
5d50b907dd
dev: update replaced version of x/tools
Make it possible to run GO111MODULE=on go get
        github.com/golangci/golangci-lint/cmd/golangci-lint@master
2019-09-10 10:34:01 +03:00
Juan Carlos
338e3fbf24 Fix install script on Windows (#626)
`adjust_format()` should use OS and not ARCH. In Windows, `$OS` will be calculated to be `"windows"` while `$ARCH` will be `"386"` or `"amd64"` (most of the time). `$ARCH` will surely never be `"windows"`.
2019-09-10 10:05:15 +03:00
Isaev Denis
6163a8a790
Support go1.13 (#670)
Setup Travis CI to run on go 1.12 and 1.13.
Update info about go versions in README.
Rebuild go.mod,go.sum on go1.13.
2019-09-09 21:54:56 +03:00
Cody Ley-Han
a8f2c27d1d Add user supplied error messages in depguard issues (#662) 2019-09-09 20:46:55 +03:00
Matthew Poer
a02e3f573b Updates README with additional nolint notes (#644)
Fixes #642
2019-09-09 20:43:21 +03:00
Alex Dupre
f84095a973 Build FreeBSD binaries (#613) 2019-09-09 18:56:18 +03:00
Isaev Denis
6864b2f764
dev: enable funlen on repo (#668) 2019-09-09 18:07:09 +03:00
Duco van Amstel
0b49095bae Make generation of demo.svg deterministic (#625) 2019-09-09 17:37:06 +03:00
Pierre Durand
cdeefb5f79 fix invalid dependencies (#605)
Some dependencies have invalid date.

Fixes #581 #595
2019-09-09 17:22:40 +03:00
techknowlogick
eabe43a53b Provide pre-built binary for ARM arch (#607)
Fix #491
2019-09-09 17:17:59 +03:00
NiseVoid
bb82273160 Add funlen linter (#603) 2019-09-09 16:56:30 +03:00
Isaev Denis
375a5a8cae
Speed up linting: use deduplicated packages (#667)
Use deduplicated packages for all linters except megacheck.
See https://github.com/golangci/golangci-lint/pull/585 for details.
2019-09-09 16:48:15 +03:00
Liam White
e1a7422dd5 Update gochecknoglobals to support version exception (#601)
See 7c3491d2b6
2019-09-09 16:42:51 +03:00
Isaev Denis
136b27171a
update bodyclose: use upstream version (#666) 2019-09-09 16:35:16 +03:00
Luke Shumaker
e87a1cfb83 Fix a false-positive from 'unused' (#585)
This false-positive is not present in the upstream stand-alone 'unused'
2019.1.1 program that golangci-lint uses.

pkg/lint.ContextLoader.filterPackages() did two things:
 1. It removed synthetic "testmain" packages (packages with .Name=="main"
    and .PkgPath ending with ".test")
 2. It removed pruned subsumed copies of packages; if a package with files
    "a.go" and "a_test.go", it results in packages.Load giving us two
    packages:
      - ID=".../a" GoFiles=[a.go]
      - ID=".../a [.../a.test]" GoFiles=[a.go a_test.go]
    The first package is subsumed in the second, and leaving it around
    results in duplicated work, and confuses the 'deadcode' linter.

However, the 'unused' linter relies on both the ".../a" and
".../a [.../a.test]" packages being present.  Pruning them causes it to
panic in some situations, which lead to this workaround:
af6baa5dc1

While that workaround got it to not panic, it causes incorrect results.

So, split filterPackages() in to two functions: filterTestMainPackages()
and filterDuplicatePackages().  The linter.Context.Packages list only
gets filterTestMainPackages() called on it, while linter.Context.Program
and linter.Context.SSAProgram get both filters applied.

With the source of the panic fixed, roll back a few now-unnecessary
commits in go-tools.
2019-09-09 16:10:49 +03:00
Denis Isaev
9ae08e9389
dev: add link to https://github.com/golang/tools/pull/139 to go.mod replacement 2019-09-09 15:33:31 +03:00
Denis Isaev
13c3082639
dev: speed up Travis CI: don't build pull requests twice 2019-09-09 15:06:08 +03:00
Denis Isaev
e39e8fb5d5 update x/tools
Significantly improve CPU and memory usage when not using SSA-powered linters.
Improve readability of go/packages errors.
Improve debugging capabilities and write doc about debugging.
2019-09-09 15:04:32 +03:00
Denis Isaev
d2b1eea2c6
bodyclose: fix race condition 2019-07-14 17:53:55 +03:00
Fernandez Ludovic
7e170af626 fix: body close panic. 2019-07-14 17:15:54 +03:00
Andrey Kuchin
e17582581d fix possible race in line cache 2019-07-14 17:08:12 +03:00
Andrey Kuchin
c5b0f95dac fix cuncurrent [read/]write panic 2019-07-14 17:08:12 +03:00
Denis Isaev
360a58dca9 dev: misspell: always build replacement 2019-06-30 10:41:25 +03:00
Hernan Bandura
f8a5a8cb01 Update depguard version to 1.0.0 (Performance improvements) 2019-06-29 23:53:05 +03:00
Trevor Pounds
22d1ef65c8 Update pkg/errors to v0.8.1. 2019-06-18 22:24:38 +03:00
Denis Isaev
3d954ea19d docs: s/v1.17.0/v1.17.1 2019-06-11 15:39:50 +03:00
Denis Isaev
4ba2155996 fix #529: exit with code 7 when error was logged v1.17.1 2019-06-10 11:44:19 +03:00
Denis Isaev
7274db714c fix #479: update go-critic to fix deps
This update should fix go get issues because of deps.

go-critic:
$ git cherry -v c3db6069acc5
+ fe28ac328f474c02e2383ca2bf44a606929a7048 checkers: add integration
tests with cgo for dupImports (#846)
+ 48a15b03b630252319474ba5ddc8455d2aebf34f checkers: fix fold-ranges
for floats in boolExprSimplify (#849)
+ 7bf73388643eb226addf2d5ed8a2c104be244b2e checkers: fix "Output:"
false positive in commentedOutCode (#852)
+ f6f702b31734df26415c2bd135f272d1a34d2973 checkers: extend
yodaStyleExpr supported ops list (#856)
+ 07bf84df361735ad1d90f84e79eb60c8386325c7 fix dependencies (#857)
+ 1df30086654074503eab008bdde4f3ce1921128d checkers: fix collection
URL (#860)

x/tools:
$ git cherry -v 685fecacd0a0 521d6ed310dd | fgrep -v internal/lsp
+ fe54fb35175bb1c0c175e2335e23d7fa90ca987a apidiff: represent a Report as a list of Changes
+ 15bbd99efc6f20619676dec93f914d12e5139e83 all: run go mod tidy
+ bb3b3ca95aec36bfc4a5cb10b58022e64aca735b go/packages: add some documentation for extractPackage
+ 4bf14f7f0668366a4275c6ef5e99bd8e807da1d3 internal/span: fix off-by-one in ToUTF16Column
+ cb2dda6eabdf9160e66ca7293897f984154a7f8b go/packages: deduplicate file parsing
+ 9e44c1c403071e0c2831952513e7b948587d94af go/internal/gccgoimporter: update package to match std lib version
+ 36563e24a2627da92566d43aa1c7a2dd895fc60d cmd/vet: verify potentially-recursive Stringers are actually Stringers
+ 31fd60d6bfdcfb2861856aa5b333bb135f6bbfd8 x/tools/go/packages/packagestest: fix GOPROXY file URLs for Windows
+ 2d660fb8a000e1c288dc2f2150401b364922ebe9 go/packages/packagestest: fix GOPROXY file URLs for Windows
+ 7af746645d5165109de0b5cb499980c22812dfc2 internal/span: fix another off-by-one in ToUTF16Column
+ 9d4d845e86f14303813298ede731a971dd65b593 cmd/goimports: add -format-only flag
+ 83df196e5764ed2415c28c1f39ba6cb3db747da0 internal/span: add a filename only print for spans
+ 5cec639030af3a6ada2732d9bfa1d3731ed55106 go/analysis: proposed fact enumeration API
+ 9cb3dcf692a103de0fd68c26f4f04183e0933f7c internal/span: update the offset if the end offset should be valid but is not
+ 2d16b83fe98cd1bed9e2ce9fdc86bd438d14aab7 go/vcs: ignore "mod" VCS type
+ 95299016986435f846545c27f956768ad3c3cb2f lostcancel: do not analyze cancel variable which defined outside current function scope
+ 8a42e17289ea392d63892321ce1f40bd07efcc9f compilebench: clean up different benchmark types
+ eeb76a0c47a3b97e99f330dc14174ef14777d2ba compilebench: factor running build tool commands
+ 60140f09094406e46618ef436a26dd8394983503 compilebench: add a linker benchmark
+ e31d36578abb3d202c4007c3747bf8ebb7c51011 compilebench: handle missing MemStats more gracefully
+ d996b19ee77cd9c8df974510f23b0696cedf1ca1 go/analysis/analysistest: fix word usage
+ 73554e0f78058c37e5421bc48273a72400172221 go/analysis/passes: fix bugs discovered in std
+ 35884eef200b5fc81c9044f644a8d9d911262488 cmd/vet: print help to stdout only
+ 45e43b2cb4facd370abb846ebf35575161849f3b go/packages/packagestest: fix MustCopyFileTree so that file fragments are always slash form
+ d81a07b7e58487eed036bf115fa834653590d6cd go/analysis/passes/bools: eliminate quadratic runtime, output
+ 2a413a02cc735933997fa1b467a7b27bc1b82567 godoc/static: let client use vet check returned by /compile endpoint
+ 4789ca9922f080dd3a8fc3c74df1c1306db2bb0b go/analysis/internal/analysisflags: call gob.Register on deleted analyzers
+ d1a3278ee74994e9aa609e9e711c616bba677d5d godoc/util: serve SVG files raw
+ 1da8801a9502f29f3f03edfc3149b947e6e1913c godoc: declare small victory over the punched card tyranny
+ 757ca719ca9689950c69081c10c5300fbb8e35db imports: rename to internal/imports
+ 0133cac3176f225883c5d817146de8633ed07ebc cmd/goimports: reuse cached state
+ 26647e34d3c04fd3eaef6fb824493b00af7b1b26 imports: allow nil Options in Process
2019-06-10 11:33:31 +03:00
Denis Isaev
c92a7a30ae docs: s/1.16/1.17 2019-06-10 10:36:04 +03:00
Trevor Pounds
d7ea266760 Fix minor grammatical error. Fixes #556. 2019-06-10 09:24:30 +03:00
Denis Isaev
b0281e853e update ineffassign 2019-06-10 09:23:57 +03:00
Denis Isaev
15858c2fb0
docs: update changelog 2019-06-10 00:22:58 +03:00
Denis Isaev
3d78f64b60 fix #522: run misspell in text mode
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.
v1.17.0
2019-06-09 20:14:19 +03:00
Denis Isaev
7db400b2d2 fix #521: explain //nolint usage in README
Also, add more tests for block-wise
usage of //nolint.
2019-06-09 17:27:42 +03:00
Denis Isaev
ad9de15a58
dev: fix go1.11 builds 2019-06-09 16:24:04 +03:00
Denis Isaev
6508d1623a fix #513: don't add gofmt "with -s" if not needed
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
2019-06-09 16:22:41 +03:00
Sonia Hamilton
5c86bfc905 junit-xml output 2019-06-09 13:23:17 +03:00
Denis Isaev
7f91ce8067
fix conflict in go.mod after merging #555 2019-06-09 13:22:03 +03:00