198 Commits

Author SHA1 Message Date
Denis Isaev
9181ca7175 Fix #78: log all warnings
1. Log all warnings, don't hide none of them
2. Write fatal messages (stop analysis) with error log level
3. Remove ugly timestamp counter from logrus output
4. Print nested module prefix in log
5. Make logger abstraction: no global logging anymore
6. Refactor config reading to config.FileReader struct to avoid passing
logger into every function
7. Replace exit codes hardcoding with constants in exitcodes package
8. Fail test if any warning was logged
9. Fix calculation of relative path if we analyze parent dir ../
10. Move Runner initialization from Executor to NewRunner func
11. Log every AST parsing error
12. Properly print used config file path in verbose mode
13. Print package files if only 1 package is analyzedin verbose mode,
  print not compiling packages in verbose mode
14. Forbid usage of github.com/sirupsen/logrus by DepGuard linter
15. Add default ignore pattern to folint: "comment on exported const"
2018-06-14 23:09:04 +03:00
Denis Isaev
a1a9215fcc Speedup program loading on 20%.
Don't typecheck func bodies for non-local packages.
Works only if megacheck and interfacer are disabled: they require all
func bodies to build SSA repr.
Export GL_DEBUG=load to get logs for this feature.
2018-06-13 20:45:46 +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
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
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
Will Dixon
d46a5896b7 Add Depguard to supported linters 2018-05-31 23:19:41 -04: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
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
b12c5591cd #33: don't pass not compiling packages to linters accepting loader.Program 2018-05-29 18:41:04 +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
b361146df8 #12: add TypeCheck linter to report compilation errors 2018-05-26 20:02:26 +03:00
golangci
ab0ce75c06 Fill README section about performance 2018-05-19 22:40:14 +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
6f384926cf fixes 2018-05-08 13:33:00 +03:00
golangci
c9d006d77a don't import packages twice for golint 2018-05-08 13:04:15 +03:00
golangci
e6657e868e don't analyze tests by default 2018-05-08 12:28:36 +03:00
golangci
511b04de5e fixes after testing all linters on self repo 2018-05-08 12:10:24 +03:00
golangci
5dc876c260 pretty printing issues 2018-05-08 11:54:30 +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
062caa018c support exclude patterns 2018-05-06 13:41:42 +03:00
golangci
30388862d2 support enabling and disabling of linters and linters list command 2018-05-06 13:25:50 +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
golangci
3f1787bf89 support errcheck 2018-05-05 19:43:52 +03:00
golangci
a0ac9b7e0b prepare testing framework 2018-05-05 11:08:14 +03:00
golangci
c17b41c59a use cobra for CLI 2018-05-05 09:24:37 +03:00
golangci
0e4998bb4f move code from golangci-worker to golangci-lint 2018-05-05 07:45:06 +03:00