23 Commits

Author SHA1 Message Date
Denis Isaev
7f833070b1
Properly detect generated files: fix detection when
there is extra line between comment about generated file and package
name
2018-06-11 12:38:52 +03:00
Denis Isaev
541656cc20
Write JSON output more compactly and output object, not array 2018-06-11 11:19:40 +03:00
Denis Isaev
adb6be78bb
Fix #72: match more autogenerated files patterns.
We skip all issues from autogenerated files.
Also reuse AST parsing for nolint and autogenerated exclude processors:
decrease processing time on golang source code from 3s to 800ms.
2018-06-11 00:51:23 +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
Denis Isaev
eee7e73dc1
#30: support --skip-files and --skip-dirs options: they skip files and dirs by regexps 2018-06-07 09:39:33 +03:00
Denis Isaev
8a9b3a5143
#65, #68: make //nolint processing like in gometalinter 2018-06-06 23:51:15 +03:00
Denis Isaev
f6a7e89d69
skip all cgo issues 2018-06-06 22:06:01 +03:00
golangci
0a111acaab refactor and don't print congrats if timeouted 2018-06-02 00:30:39 +03:00
Stephan Renatus
468d2334ea change isGenerated heuristic to match more generated files
As observed in #30, there's tools out there that don't comply 100% with
the referenced golang convention.

With this change, golangci-lint will skip some more of those generated
files.

Signed-off-by: Stephan Renatus <srenatus@chef.io>
2018-05-31 09:15:22 +02:00
golangci
cad9fc7760 #26: fix spaces in nolint directive 2018-05-28 12:19:55 +03:00
golangci
b361146df8 #12: add TypeCheck linter to report compilation errors 2018-05-26 20:02:26 +03:00
golangci
e73a876b0f support patch reading from env var 2018-05-13 12:05:34 +03:00
golangci
85ee97f776 support config and fix issues in self project 2018-05-11 22:02:24 +03:00
golangci
051922e5c8 more excludes and pretty logs 2018-05-08 22:28:29 +03:00
golangci
07ddc548dc another group of fixes after running on golang source code 2018-05-08 18:08:28 +03:00
golangci
d993d3a264 group of fixes after running on golang source code 2018-05-08 17:13:16 +03:00
golangci
5dc876c260 pretty printing issues 2018-05-08 11:54:30 +03:00
golangci
073ad51ed9 support diff options 2018-05-08 09:55:38 +03:00
golangci
393733fa6a implement max issues per linter limiting 2018-05-08 08:15:55 +03:00
golangci
4853151835 async issues processing 2018-05-07 21:44:40 +03:00
golangci
51c1751db0 support megacheck 2018-05-06 22:58:04 +03:00
golangci
3f1787bf89 support errcheck 2018-05-05 19:43:52 +03:00
golangci
0e4998bb4f move code from golangci-worker to golangci-lint 2018-05-05 07:45:06 +03:00