529 Commits

Author SHA1 Message Date
Denis Isaev
93b2d10537 docs: make readme after the last README fix 2019-01-08 10:02:12 +03:00
Zamiell
50abb24e68 fixing readme bug 2019-01-08 10:02:12 +03:00
David López
d9a1bdb831 gocritic: fix code to pass newly added gocritic checks
Fix code to pass newly added gocritic checks, mainly pointer receivers and import shadows
2019-01-08 09:59:24 +03:00
Isaev Denis
21a8185fd2 remove extra --version from README.md 2019-01-08 09:59:24 +03:00
David López
0192cb3955 gocritic: update default checks list
Update gocritic default checks list, add the current gocritic stable checks list
2019-01-08 09:59:24 +03:00
Denis Isaev
658f4addbd
docs: fix errcheck ignore example 2018-12-23 13:03:17 +03:00
Denis Isaev
609de3254c Fix #331: fix errcheck "ignore" config directive.
Make tests for "ignore" and "exclude" directives.
Mark all hidden command-line options as deprecated.
v1.12.5
2018-12-23 12:33:41 +03:00
Denis Isaev
21c2590ba8
Fix #318: better validate linters and help commands v1.12.4 2018-12-22 15:55:53 +03:00
Denis Isaev
a4a7100011 Fix #263: update goimports
The new version of goimports works 100x faster
with go modules. Also it has some new features:

$ git cherry -v 6c7e314b6563 92cdcd90bf52 | fgrep imports
+ 5bbcdc15656ef390fab5dd6e8daf95354f7171e3 imports: redesign fixImports
+ ee45598d2ff288037f53f9e13ae0b1a6e2165ad5 imports: create named imports for name/path mismatches (again)
+ 4c53570e0460bc32468f75bf9dd71c018d03bfa9 imports: ignore globals in different packages
+ 1d424dbce8dd500e9e449fd3ff9d0668c09e2ae1 imports: clean up customization seam
+ 6a3e9aa2ab7749d72d1006ee484271b4a11f96c2 imports: fix renamed sibling imports
+ 5f4a60f04f23ac48e0665f257413ae3eacf339be imports: fix renamed sibling imports more
+ bbccd8cae4a9a47e0f978e03ff4b5df88a9fde1e imports: use go/packages, support modules
+ d4971274fe382404aee0e8c163af974f2bf738e6 imports: don't remove imports that conflict with globals
2018-12-22 15:50:16 +03:00
Denis Isaev
c9c0646265 dev: fix go.sum and don't skip test TestGoimportsLocal 2018-12-22 15:34:16 +03:00
David López
37e6995b45 lintpack/gocritic: update lintpack & gocritic versions
update lintpack & gocritic versions to support all the new gocritic checks
2018-12-22 15:34:16 +03:00
Denis Isaev
f5902eb01f
docs: regenerate README.md 2018-12-22 15:26:06 +03:00
Denis Isaev
4f0fddf4fe
add tests for abs path args 2018-12-22 14:16:31 +03:00
Alexander Morozov
baa2415ddf Use go env GOPATH for installation
People these days tend to use default GOPATH, so environment variable will be empty.

go env GOPATH will work for all cases

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2018-12-22 14:05:24 +03:00
Koichi Shiraishi
85cf013e2b README: run 'make readme' 2018-12-22 14:00:49 +03:00
Koichi Shiraishi
50a41f4ec3 README.tmpl: fix 'No newline at end of file' git suggestion 2018-12-22 14:00:49 +03:00
Koichi Shiraishi
eda89bda2d README.tmpl: add istio/istio to "Trusted By" section 2018-12-22 14:00:49 +03:00
David Golub
7063a9d870 Fix errors when specifying absolute path 2018-12-22 13:44:30 +03:00
Denis Isaev
99329fb637
dev: remove extra logging in skip dirs processor 2018-12-22 13:44:16 +03:00
Denis Isaev
09c65fcf42 rework modules download mode option 2018-12-22 13:37:17 +03:00
Nicolae Vartolomei
b693037af0 Allow configure module download mode 2018-12-22 13:37:17 +03:00
Denis Isaev
7dfb9cff3d rework skip dir algorithm 2018-12-22 12:24:43 +03:00
Sean Chittenden
441bdb33d1 Fix the skip-dirs option.
Prior to this change the SkipDir runner was not skipping files such as
`foo/bar/baz.go` with a `skip-dir` entry of `foo/bar` when the `run`
command was invoked with an argument of `foo/...`.  This is both a
surprising and problematic behavior change.

The pathology was:

1. `shouldPassIssue()` was receiving an input like `foo/bar/baz.go`
2. `shouldPassIssue()` would call `p.getLongestArgRelativeIssuePath()`
   which was returning `bar`, not `foo/bar` as expected.
3. The reason for this was because inside of
   `getLongestArgRelativeIssuePath()` it was trimming the prefix that
   matched the path prefix (e.g. `foo/`).

If you have the file structure:

  - foo/bar/baz.go
  - bur/bar/baz.go

There is no way to isolate `foo/bar` from `bur/baz` without strictly
controlling both your `skip-dirs` configuration and the arguments to
`run`.

The rest of the logic to skip files that don't match `run`'s argument
is valid, however the regexp should be evaluated based on the
`filepath.Dir()` of the input (e.g. `foo/bar`) and not the truncated
version of the issue's filepath.

Fixes: #301
2018-12-22 12:24:43 +03:00
Aneesh Agrawal
e72fe0540d Add .pre-commit-hooks.yaml
This file will allow using golangci-lint with https://pre-commit.com.
2018-12-22 10:37:11 +03:00
Ben Wells
ef78643830 Fix typo in gometalinter comparison example 2018-11-28 08:31:11 +03:00
Denis Isaev
4be4794406 don't stop megacheck on main packages
even if the main package does not compile, analyze a program by megacheck
2018-11-24 19:39:15 +03:00
Denis Isaev
014a924d6c
remove unnecessary command from Dockerfile v1.12.3 2018-11-24 09:25:36 +03:00
Denis Isaev
255a39bcb1 fix #302: fix concurrent astcache access 2018-11-24 09:09:31 +03:00
Denis Isaev
dba3907ff3 improve typecheck errors parsing 2018-11-23 18:40:25 +03:00
Denis Isaev
55a18ae18a
don't make typecheck issues without file/line info 2018-11-18 16:45:06 +03:00
Denis Isaev
7278b7ae8a
setup typecheck error file if it's empty 2018-11-18 15:50:15 +03:00
Denis Isaev
27752e81a7 add command 'golangci-lint config path' 2018-11-18 11:28:59 +03:00
Tim Heckman
cb5d1da986 Add support for home directory expansion for -c/--config flag
This change introduces the ability to use the tilde (`~`) character in your
`-c/--config` flag value to expand your home directory. If invoking this via the
command line with `--config ~/.golangci-lint.yaml`, the user's shell expands the
`~` to the home directory. However, if something is invoking the program for
you (like an editor) it may not do the expansion.

Fixes #289

Signed-off-by: Tim Heckman <t@heckman.io>
2018-11-14 14:30:26 +03:00
Denis Isaev
898ae4d364 fix #277, fix #260: fix crash
Fix crash because of parallel access to ssa.Program
v1.12.2
2018-11-10 16:20:49 +03:00
Denis Isaev
952cc0b22e
fix hangup of golangci-lint on large projects with compilation errors 2018-11-10 14:32:26 +03:00
Denis Isaev
ac77eaac68 Fix #282, fix #209: revert goimports commit
ed64e33c8c8bc9a919e2b85a1a08225b5ae59d70. Also add tests
for local mode of goimports and do refactoring of tests.
v1.12.1
2018-11-10 11:46:37 +03:00
Denis Isaev
7836034ecf dev: fix tests v1.12 2018-11-07 11:53:30 +03:00
Denis Isaev
b3f4d6a9b2
docs: add info about new linters to changelog 2018-11-07 10:47:51 +03:00
Denis Isaev
7d51954355 fix #199: support gochecknoinits, gochecknoglobals
Add 2 new linters
2018-11-07 10:47:08 +03:00
Denis Isaev
a57bc83d70 On of cases for #260: fix crash in staticcheck
1. Fix crash if deps of analyzed packages weren't compiled.
2. Print deps typechecking errors
3. Fix all issues filtering because of empty go env GOCACHE for go < 1.10
2018-11-07 10:06:55 +03:00
Denis Isaev
0935ce1b8d fix #132: support go-critic linter 2018-11-07 09:11:08 +03:00
Dale Hui
89b7e42dbf Use git describe --tags to get most recent tag reachable from HEAD 2018-11-06 08:16:19 +03:00
Denis Isaev
84c9c65f39 fix #243: support Scopelint linter 2018-11-06 08:11:25 +03:00
Denis Isaev
ccac35a87e Fix false positives with unused identifiers
Issue #265: don't report unused warning when an identifier is
used only in tests.
v1.11.3
2018-11-05 14:11:14 +03:00
Denis Isaev
3345c7136f fix #264: fix Windows compatibility
Fix skip-dirs regexps and 'go env' on Windows.
2018-11-05 12:54:40 +03:00
Denis Isaev
c02a6daa5c Fix #263: fix goimports performance with modules
Apply https://go-review.googlesource.com/c/tools/+/132598/ as a
temporary fix before a proper fix is in golang.org/x/tools
2018-11-05 12:37:54 +03:00
Denis Isaev
a4d7d7a428
logging for corrupted SSA packages 2018-11-04 13:57:50 +03:00
Denis Isaev
0bc25236b8 fix #266: docs: reorder sections and update changelog 2018-11-04 13:27:59 +03:00
Denis Isaev
71b940e3b2 fix markdownlint issues 2018-11-04 13:27:59 +03:00
Denis Isaev
21c9965f50
docs: #267: update CLA text 2018-11-04 11:39:45 +03:00