86 Commits

Author SHA1 Message Date
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
f5a9bbb140
don't run megacheck if there are not compiling packages and warn about it 2018-06-10 09:22:21 +03:00
Denis Isaev
61c0974323
improved warnings logging 2018-06-08 08:43:43 +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
Denis Isaev
afc4b4344f
#66: properly merge (not overwrite) slice flags from config and command-line 2018-06-06 09:11:21 +03:00
Andrew Shannon Brown
41719ec87e
Fix typo in includeGoRoot config field 2018-06-03 19:24:24 -07:00
Denis Isaev
ad3bf1eb58
fix --version option and improve installation section of docs 2018-06-03 09:25:53 +03:00
Denis Isaev
f62d607410
#37: add tab output format: --out-format=tab 2018-06-02 21:01:09 +03:00
Denis Isaev
0f6213dbc2
#60: search config file in directories from file path up to root 2018-06-02 20:28:53 +03:00
Denis Isaev
b0826710b5
#52: #36: lint test files by default: set --tests=false to disable it 2018-06-02 18:24:00 +03:00
Denis Isaev
4fd5ebe7c7
#49: don't fill string slice 2 times because of double parsing of options 2018-06-02 17:50:38 +03:00
golangci
9133ef4271 generate command line options section of README 2018-06-02 16:01:20 +03:00
golangci
034728ec94 generate parts of README automatically 2018-06-02 11:37:17 +03:00
golangci
0a111acaab refactor and don't print congrats if timeouted 2018-06-02 00:30:39 +03:00
golangci
2f333be584
Merge pull request #47 from dixonwille/feature/add-depguard
Add Depguard to supported linters
2018-06-01 23:40:41 +03:00
Will Dixon
d46a5896b7 Add Depguard to supported linters 2018-05-31 23:19:41 -04: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
ef81b998ed #45: fix no results for gocyclo 2018-05-30 20:01:44 +03:00
golangci
80a5ff2eff
Merge pull request #42 from dixonwille/feature/better-memory-alloc-for-slices
Allocate memory for known size slices
2018-05-30 17:32:14 +03:00
Will Dixon
d3762b88e3
Remove the GoCyclo append
as BuildStats already appends
2018-05-30 09:33:25 -04:00
golangci
b28bf5fbee #41: exit with code 4 if timeouted 2018-05-30 09:45:08 +03:00
golangci
5646c61c73 #40: fix panic in fast mode 2018-05-30 09:18:13 +03:00
Will Dixon
b699340d13 Allocate memory for known size slices 2018-05-29 19:42:49 -04:00
golangci
5363497113 skip dirs without go files early: improve logs and save time 2018-05-29 20:17:49 +03:00
golangci
b12c5591cd #33: don't pass not compiling packages to linters accepting loader.Program 2018-05-29 18:41:04 +03:00
golangci
ae5152c024 fix GOROOT after cross-compilation 2018-05-29 14:15:09 +03:00
golangci
0e4282179f make releases 2018-05-29 11:18:47 +03: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
cad9fc7760 #26: fix spaces in nolint directive 2018-05-28 12:19:55 +03:00
golangci
ad581d3b55 #23: improve help text for --concurrency 2018-05-28 11:41:21 +03:00
golangci
f96d8ba829 fix vendoring and log concurrency 2018-05-27 11:27:21 +03:00
golangci
eea1b93967 #14: support color output on windows 2018-05-27 08:53:55 +03:00
golangci
cc53468e1e #13: fix --fast option: allow enable disabled by --fast linters 2018-05-26 21:07:38 +03:00
golangci
b361146df8 #12: add TypeCheck linter to report compilation errors 2018-05-26 20:02:26 +03:00
xuri
5b8ffcaf76
Fix typo. 2018-05-26 21:59:09 +08:00
golangci
35f2cc3d39
Merge pull request #10 from golangci/feature/add-column-and-disable-welcome-message
add column of issue line; disable welcome message by default
2018-05-26 09:50:35 +03:00
golangci
17c05c062b add column of issue line; disable welcome message by default 2018-05-26 09:48:16 +03:00
golangci
d86489893d move log handling code into root command 2018-05-25 22:30:44 +03:00
golangci
65330f8f0c improve benchmark 2018-05-22 22:43:47 +03:00
golangci
ab0ce75c06 Fill README section about performance 2018-05-19 22:40:14 +03:00
golangci
cdc1251fc0 optimize linters scheduling: run slow linters first 2018-05-19 16:20:43 +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
5c2e6e9f5a .travis.yml and don't use internal package 2018-05-13 19:20:42 +03:00
golangci
e73a876b0f support patch reading from env var 2018-05-13 12:05:34 +03:00
golangci
9dd2baf8bd enable different set of linters for golangci.com 2018-05-13 09:30:17 +03:00
golangci
05f09371ac validate config and print resources usage 2018-05-12 10:13:37 +03:00
golangci
85ee97f776 support config and fix issues in self project 2018-05-11 22:02:24 +03:00