112 Commits

Author SHA1 Message Date
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
1a9af12d6d Fix #96: support lll 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
78d39711f0
docs: s/.golangci.yml/.golangci.example.yml 2018-06-19 09:30:55 +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
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
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
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
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
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
9ed7dad894
#77: move changes from README.md to README.md.tmpl 2018-06-09 00:01:54 +03:00
Charl Matthee
5862a4b8a4
Language changes and fixed some typos.
Language changes and fixed some typos.
2018-06-08 09:21:23 +02:00
Denis Isaev
1fad9ea1d7
add information about GoLand support into README.md 2018-06-07 23:42:52 +03:00
Denis Isaev
c144a3c731
update information about editor integration and nolint in README.md 2018-06-07 23:17: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
ad3bf1eb58
fix --version option and improve installation section of docs 2018-06-03 09:25:53 +03:00
Denis Isaev
e8fb3a5166
docs: update contact info 2018-06-03 00:37:22 +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
d4d2697f8a add svg demo 2018-06-02 14:10:34 +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
golangci
71fe07cf9e
Update README.md 2018-05-31 19:00:38 +03:00
golangci
a0414984e5
Update README.md 2018-05-29 17:46:32 +03:00
golangci
96a192058f Information about releases in README.md
This reverts commit eb7998a5a8a505679d2c562d9e8473a0816eabc1.
2018-05-29 14:15:18 +03:00
golangci
eb7998a5a8 Revert "Update README.md"
This reverts commit 5998a81a7d24c063e04be469079e5c1aeed5e2c4.
2018-05-29 13:16:38 +03:00
golangci
5998a81a7d
Update README.md 2018-05-29 12:15:39 +03:00
golangci
c1f2d0602b
Update README.md 2018-05-28 14:54:03 +03:00
golangci
7d224b1684
Merge pull request #24 from y0ssar1an/master
Improve FAQ instructions for vendoring golangci-lint
2018-05-28 11:49:58 +03:00
golangci
543f4b9fd2
Contact information 2018-05-28 11:31:58 +03:00
golangci
d44b145679
Update information about integrations 2018-05-28 11:31:25 +03:00
Ryan Boehning
aa68ffbe25 Improve instructions for vendoring golangci-lint in FAQ section of README
The section on vendoring golangci-lint fails to mention that it should be added
to the required section in Gopkg.toml. Without this section, the vendored
golangci-lint would be deleted on the next dep ensure -update. Also, some of the
wording was a bit awkward.
2018-05-27 10:33:15 -07:00
golangci
61463e305f
Add information about Emacs integration 2018-05-27 17:59:24 +03:00
golangci
f6dde5c844
Update README.md 2018-05-27 11:54:10 +03:00
golangci
1ccbc01764
Update README.md 2018-05-27 11:45:45 +03:00
golangci
c2e7e488e2
Update README.md 2018-05-27 09:41:13 +03:00
golangci
8802872d65
Update README.md 2018-05-27 09:31:30 +03:00
golangci
45de6fd8b7
Merge pull request #15 from golangci/feature/check-compilation-errors
Feature/check compilation errors
2018-05-26 20:33:45 +03:00
golangci
51d178da8e
Update README.md 2018-05-26 20:32:33 +03:00
golangci
b361146df8 #12: add TypeCheck linter to report compilation errors 2018-05-26 20:02:26 +03:00
golangci
8dc131dc3f
Update README.md 2018-05-26 10:03:41 +03:00