719 Commits

Author SHA1 Message Date
Denis Isaev
d02ac2466e disable go1.11 in travis and make some small fixes for go1.11 v1.9.2 2018-07-29 13:00:41 +03:00
Denis Isaev
3a806e9c78
add gcc to dockerfile: cgo doesn't work without it 2018-07-28 23:49:55 +03:00
Denis Isaev
99d04546ce
fix crashes on go1.11: build releases on go1.11 2018-07-28 23:48:17 +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
5d04557a1f #156, #157: properly detect type errors in dependencies 2018-07-28 23:47:22 +03:00
Fabrice Rabaute
e17b9543e7 Add tab-width option to lll linter 2018-07-25 23:13:14 +03:00
Denis Isaev
6ccd0c5e53
docs: ISSUE_TEMPLATE.md, PULL_REQUEST_TEMPLATE.md 2018-07-25 23:09:56 +03:00
Denis Isaev
d993a423bf
docs: remove extra new line from .golangci.example.yml 2018-07-03 19:49:05 +03:00
Eldar Rakhimberdin
d78dccef76 Fix comment message 2018-07-03 19:47:05 +03:00
Eldar Rakhimberdin
9b866bcff1 Fix comment message 2018-07-03 19:47:05 +03:00
Denis Isaev
79776b41f9 Fix #150: don't recommend vendoring of golangci-lint in README 2018-07-03 09:52:13 +03:00
Denis Isaev
1774bf22a2 Fix #148: fix false-positive from unused if cgo is used v1.9.1 2018-07-01 21:52:21 +03:00
Denis Isaev
95b0757a3f Fix marking file with cgo as autogenerated 2018-07-01 21:52:21 +03:00
Denis Isaev
894ba0df9f Resolve #146: prealloc linter support v1.9 2018-06-30 22:07:12 +03:00
Denis Isaev
815d13148f docs: add changelog, rewrite internal section, add trusted by section 2018-06-30 21:00:47 +03:00
Denis Isaev
35f9d8e5b9 Fix unparam crash on nil constant 2018-06-30 20:08:05 +03:00
Denis Isaev
facc3a096a Fix #98: nakedret linter support 2018-06-30 15:41:47 +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
70193b9b4d
docs: improve shell installation info 2018-06-30 09:24:50 +03:00
Denis Isaev
3ce87e6245 Fix #139: don't fail govet on cgo 2018-06-30 09:23:31 +03:00
Denis Isaev
6dd4f07c50
Fix file leak in lll v1.8.1 2018-06-29 08:28:12 +03:00
Denis Isaev
1a9af12d6d Fix #96: support lll v1.8 2018-06-28 23:03:11 +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 v1.7.3 2018-06-28 10:17:16 +03:00
Denis Isaev
5ef542facd Print first compilation error in warning about inability to run megacheck because of compilation errors 2018-06-28 09:18:41 +03:00
Denis Isaev
fb38e51c83 add all warnings and error to json if out-format=json 2018-06-24 11:29:41 +03:00
Denis Isaev
93311aee9b Fix #122: don't crash govet on tests-only packages v1.7.2 2018-06-19 16:32:36 +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
v1.7.1
2018-06-19 09:59:13 +03:00
Denis Isaev
78d39711f0
docs: s/.golangci.yml/.golangci.example.yml 2018-06-19 09:30:55 +03:00
Denis Isaev
020c948089 Analyze project even if fatal import dir error
Before that fix golangci-lint couldn't run analysis
if in any dir there was go file with corrupted `package` or `import`
statement.
After that fix it will only warn about such files and continue analysis.
But it will fail analysis after finding 10 packages with such errors
to not being too noisy in case of internal error.
2018-06-18 23:50:47 +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)
v1.7
2018-06-18 09:47:15 +03:00
Henrik Johansson
f239b80ce1 disable the congrats message
There is now an extra switch '-s' to disable the congrats message when
there are no issues detected

Fixes: #110
2018-06-17 00:17:48 +03:00
Denis Isaev
2de1f87c10 Fix #102: fix file descriptors leak inside errcheck 2018-06-16 12:57:10 +03:00
Denis Isaev
9fa9e2b3f8 Fix #106: fix transitive expanding of nolint: we could nolint more lines than needed 2018-06-16 10:56:58 +03:00
Iskander Sharipov
7495c4d13a readme: fix invalid link to issues-options
issues-options heading does not exist anymore.
Closes thing is command-line-options.
2018-06-15 22:41:20 +03:00
Denis Isaev
7f1779d706
docs: remove extra backtick from README.md.tmpl
Fix stale template after #103
2018-06-15 00:06:30 +03:00
Sriram Venkatesh
7f17cf01e5 Remove extra backtick in install step
This just removes the extra back in the `go install` step. Helps people (like me) that just copy paste blindly into a Makefile or into the cmdline!
2018-06-15 00:04:42 +03:00
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
Maksym
219a5479c8 Checkstyle support (#95)
Implement checkstyle printer
2018-06-13 20:54:13 +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
Isaev Denis
6480aa8b19
Merge pull request #89 from golangci/support/fix-mockgen-detecting
Write debug logs for autogen excluding for #86
2018-06-12 15:44:23 +03:00
Denis Isaev
f9027f7dbe
Write debug logs for autogen excluding for #86 2018-06-12 15:32:34 +03:00
Denis Isaev
b4bf038095
docs: improve FAQ and remove -i from go install command 2018-06-12 14:20:36 +03:00
Denis Isaev
6e12ea5734
docs: add FAQ entry about go install 2018-06-12 10:07:10 +03:00
Denis Isaev
1ff1d6733f
ignore 'comment on exported type ... should be of the form' by default 2018-06-11 18:57:33 +03:00
Denis Isaev
84520c527e
dev: add forgotten file test/testdata/autogenerated/mockgen.go 2018-06-11 12:51:06 +03:00
Isaev Denis
7c70250d8c
Merge pull request #84 from golangci/support/detect-mockgen-properly
Properly detect generated files: fix detection when
v1.6.1
2018-06-11 12:47:17 +03:00
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
Isaev Denis
89921943e1
Merge pull request #83 from golangci/feature/improve-json-output
Write JSON output more compactly and output object, not array
2018-06-11 11:46:43 +03:00
Denis Isaev
541656cc20
Write JSON output more compactly and output object, not array 2018-06-11 11:19:40 +03:00