52 Commits

Author SHA1 Message Date
Cezar Sa Espinola
0e2be20016 vendor: update golang.org/x/tools including goimports formatting changes
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.
2018-10-20 10:40:40 +03:00
Ariel Mashraki
3e87812087 address CR comments 2018-10-10 21:54:11 +03:00
Ariel Mashraki
b81346f9d3 linters/errcheck: add support for ignore/exclude flags
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.
2018-10-10 21:54:11 +03:00
Denis Isaev
0ef36f43d5 Prepare for #205: use forked repos without aliases 2018-09-02 14:46:54 +03:00
Denis Isaev
f93c2e0ab2 Fix #164: update GAS to the latest gosec 2018-09-02 09:34:35 +03:00
Denis Isaev
284447fc07 prettify issue texts 2018-08-18 23:04:27 +03:00
Denis Isaev
2db694a3ff exit with the code 5 if no go files to analyze 2018-08-17 21:20:54 +03:00
Denis Isaev
faa7599c95 Close #191: fork Misspell and merge 3 pending PR-s into it 2018-08-09 21:30:35 +03:00
Denis Isaev
0262f00bfb Fix #130: update ineffassign: fix crash on break/continue outside of loop 2018-08-09 00:21:21 +03:00
Will Dixon
a2450a5281 Path Prefix was broken on depguard 2018-08-06 23:42:57 +03:00
Will Dixon
1f3d5b2e42 Update depguard with Glob matching support 2018-08-04 09:28:17 +03:00
Denis Isaev
973c9fdfd8 Fix #126: fix working with symlinks 2018-07-29 22:45:35 +03:00
Denis Isaev
c5721f50d0 update Gopkg.lock for a newer dep format and update x/tools package 2018-07-28 23:47:22 +03:00
Denis Isaev
894ba0df9f Resolve #146: prealloc linter support 2018-06-30 22:07:12 +03:00
Denis Isaev
35f9d8e5b9 Fix unparam crash on nil constant 2018-06-30 20:08:05 +03:00
Denis Isaev
a6b91ccc77 Fix #124: support unparam linter
1. Support unparam linter and fix found issues
2. Replace forked mvdan.cc/lint and mvdan.cc/interfacer with the
upstream ones
3. Minimize forked megacheck: move the most of it's code to this repo
4. Use golang.org/x/tools/go/ssa import path instead of custom fork
paths
5. In golang.org/x/tools/go/{ssa,callgraph} use changed code from
honnef.co/go/tools
6. Add megacheck.check-unexported option: it found some issues in
the repo, fixed them all
2018-06-30 12:24:07 +03:00
Denis Isaev
7b2a63dfa6 Fix #100: misspell linter support 2018-06-28 21:52:30 +03:00
Denis Isaev
88ebabc4bc Fix #109, #116, #131: don't report in deadcode about unused test functions in main package 2018-06-28 10:17:16 +03:00
Denis Isaev
ebbfc26e88 Fix #94: load object files for govet for old go
Do it in compatible with old go versions object files way:
use golang.org/x/tools/go/gcexportdata instead of importer.Default
2018-06-19 09:59:13 +03:00
Denis Isaev
5514c4393e Fix #17, #87: govet becomes SLOW linter by default
1. Allow govet to work in 2 modes: fast and slow. Default is slow.
In fast mode golangci-lint runs `go install -i` and `go test -i`
for analyzed packages. But it's fast only when:
  - go >= 1.10
  - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached
  between CI builds
In slow mode we load program from source code like for another linters
and do it only once for all linters.

3. Patch govet code to warn about any troubles with the type
information. Default behaviour of govet was to hide such warnings.
Fail analysis if there are any troubles with type loading: it will
prevent false-positives and false-negatives from govet.

4. Describe almost all options in .golangci.example.yml and
include it into README. Describe when to use slow or fast mode of govet.

5. Speed up govet: reuse AST parsing: it's already parsed once by
golangci-lint.
For "slow" runs (when we run at least one slow linter) speedup by
not loading type information second time.

6. Improve logging, debug logging

7. Fix crash in logging of AST cache warnings (#118)
2018-06-18 09:47:15 +03:00
Denis Isaev
2de1f87c10 Fix #102: fix file descriptors leak inside errcheck 2018-06-16 12:57:10 +03:00
Denis Isaev
2b587b63d6
Load AST for fast linters in different way.
Use build.Import instead of manual parser.ParseFile and paths traversal. It allows:
1. support build tags for all linters.
2. analyze files only for current GOOS/GOARCH: less false-positives.
3. analyze xtest packages (*_test) by golint: upstream golint and
gometalinter can't do it! And don't break analysis on the first xtest
package like it was before.
4. proper handling of xtest packages for linters like goconst where
package boundary is important: less false-positives is expected.

Also:
1. reuse AST parsing for golint and goconst: minor speedup.
2. allow to specify path (not only name) regexp for --skip-files and
--skip-dirs
3. add more default exclude filters for golint about commits:
`(comment on exported (method|function)|should have( a package)?
    comment|comment should be of the form)`
4. print skipped dir in verbose (-v) mode
5. refactor per-linter tests: declare arguments in comments, run only
one linter and in combination with slow linter
2018-06-10 23:46:24 +03:00
Will Dixon
d46a5896b7 Add Depguard to supported linters 2018-05-31 23:19:41 -04:00
golangci
f6b51b933e use gocyclo with changes for upstreaming, also speedup it 10x when program is loaded 2018-05-28 17:36:16 +03:00
golangci
f96d8ba829 fix vendoring and log concurrency 2018-05-27 11:27:21 +03:00
golangci
5b00f5bf63 update revgrep 2018-05-26 20:02:06 +03:00
golangci
65330f8f0c improve benchmark 2018-05-22 22:43:47 +03:00
golangci
328b32ac61 fix config validation 2018-05-19 13:07:55 +03:00
golangci
f6b2d368a0 started README 2018-05-15 09:07:27 +03:00
golangci
85ee97f776 support config and fix issues in self project 2018-05-11 22:02:24 +03:00
golangci
d993d3a264 group of fixes after running on golang source code 2018-05-08 17:13:16 +03:00
golangci
073ad51ed9 support diff options 2018-05-08 09:55:38 +03:00
golangci
4853151835 async issues processing 2018-05-07 21:44:40 +03:00
golangci
c9bb265140 fix small bugs 2018-05-07 17:30:33 +03:00
golangci
9d95267977 support gas 2018-05-07 14:02:27 +03:00
golangci
0af6cacb28 support goconst 2018-05-07 12:49:17 +03:00
golangci
7291da1e5a support unconvert 2018-05-07 12:00:17 +03:00
golangci
c6dc47bcbd support interfacer 2018-05-07 11:13:26 +03:00
golangci
364dd68ed8 support ineffassign 2018-05-07 09:25:00 +03:00
golangci
7c4ab92d00 support dupl 2018-05-07 09:17:13 +03:00
golangci
51c1751db0 support megacheck 2018-05-06 22:58:04 +03:00
golangci
2bc4eaa8ae support maligned 2018-05-06 21:08:53 +03:00
golangci
b152b3500f support varcheck and structcheck 2018-05-06 20:28:59 +03:00
golangci
5c074ddfc6 load program only once: big speedup 2018-05-06 19:08:34 +03:00
golangci
d02ef1b633 support gocyclo 2018-05-06 15:24:45 +03:00
golangci
b3f856af80 support deadcode 2018-05-06 14:52:59 +03:00
golangci
16a24dc92b fix govet: don't recurse into dirs 2018-05-06 09:53:37 +03:00
golangci
ffd2723a3d support gofmt and goimports 2018-05-06 09:41:48 +03:00
golangci
e65203921b support golint 2018-05-06 07:20:12 +03:00
golangci
0a5924afbc support go vet 2018-05-05 22:22:21 +03:00