You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GolangCI-Lint is a linters aggregator. It's fast: on average [5 times faster](#performance) than gometalinter.
7
-
It's [easy to integrate and use](#command-line-options), has [nice output](#quick-start) and has a minimum number of false positives.
7
+
It's [easy to integrate and use](#command-line-options), has [nice output](#quick-start) and has a minimum number of false positives. It supports go modules.
8
8
9
9
GolangCI-Lint has [integrations](#editor-integration) with VS Code, GNU Emacs, Sublime Text.
10
10
11
+
Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci).
12
+
11
13
Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running linters on Github pull requests. Free for Open Source.
(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win).)
98
+
99
+
(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). Or you can run just `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`.)
98
100
99
101
You can also install it on MacOS using [brew](https://brew.sh/):
100
102
@@ -329,15 +331,14 @@ Read [this section](#internals) for details.
329
331
We don't fork to call specific linter but use its API.
330
332
For small and medium projects 50-90% of work between linters can be reused.
331
333
332
-
* load `loader.Program` once
334
+
* load `[]*packages.Package` by `go/packages` once
333
335
334
336
We load program (parsing all files and type-checking) only once for all linters. For the most of linters
335
337
it's the most heavy operation: it takes 5 seconds on 8 kLoC repo and 11 seconds on `$GOROOT/src`.
336
338
* build `ssa.Program` once
337
339
338
340
Some linters (megacheck, interfacer, unparam) work on SSA representation.
339
341
Building of this representation takes 1.5 seconds on 8 kLoC repo and 6 seconds on `$GOROOT/src`.
340
-
`SSA` representation is used from a [fork of go-tools](https://github.com/dominikh/go-tools), not the official one.
341
342
342
343
* parse source code and build AST once
343
344
@@ -349,17 +350,11 @@ Read [this section](#internals) for details.
349
350
350
351
It takes 300-1000 ms for `$GOROOT/src`.
351
352
2. Smart linters scheduling
352
-
353
+
353
354
We schedule linters by a special algorithm which takes estimated execution time into account. It allows
354
355
to save 10-30% of time when one of heavy linters (megacheck etc) is enabled.
355
356
356
-
3. Improved program loading
357
-
358
-
We smartly use setting `TypeCheckFuncBodies` in `loader.Config` to build `loader.Program`.
359
-
If there are no linters requiring SSA enabled we can load dependencies of analyzed code much faster
360
-
by not analyzing their functions: we analyze only file-level declarations. It makes program loading
361
-
10-30% faster in such cases.
362
-
4. Don't fork to run shell commands
357
+
3. Don't fork to run shell commands
363
358
364
359
All linters are vendored in the `/vendor` folder: their version is fixed, they are builtin
365
360
and you don't need to install them separately.
@@ -830,13 +825,14 @@ You have 2 choices:
830
825
831
826
We don't recommend vendoring `golangci-lint`in your repo: you will get troubles updating `golangci-lint`. Please, use recommended way to install with the shell script: it's very fast.
832
827
833
-
**Does I need to run `go install`?**
828
+
**Do I need to run `go install`?**
834
829
835
830
No, you don't need to do it anymore.
836
831
837
832
**Which go versions are supported**
838
-
Golangci-lint versions > 1.10.2 supports Go 1.10 and 1.11.
839
-
Golangci-lint versions <= v1.10.2 supported Go 1.9, 1.10, 1.11.
833
+
Short answer: go 1.10 and newer are supported.
834
+
835
+
Long answer: golangci-lint > 1.10.2 supports Go 1.10 and 1.11; golangci-lint <= v1.10.2 supports Go 1.9, 1.10, 1.11.
840
836
841
837
**`golangci-lint` doesn't work**
842
838
@@ -850,6 +846,7 @@ Usually this options is used during development on local machine and compilation
850
846
851
847
## Thanks
852
848
849
+
Thanks to all [contributors](https://github.com/golangci/golangci-lint/graphs/contributors)!
853
850
Thanks to [alecthomas/gometalinter](https://github.com/alecthomas/gometalinter) for inspiration and amazing work.
854
851
Thanks to [bradleyfalzon/revgrep](https://github.com/bradleyfalzon/revgrep) for cool diff tool.
855
852
@@ -876,8 +873,34 @@ Thanks to developers and authors of used linters:
876
873
877
874
## Changelog
878
875
876
+
Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci).
879
877
There is the most valuable changes log:
880
878
879
+
### January 2019
880
+
881
+
1. Update `megacheck` (`staticcheck`) to the latest version: it consumes much less memory.
882
+
2. Support the new `stylecheck` linter.
883
+
3. Update `go-critic` to the latest version.
884
+
4. Support of `enabled-tags` options for`go-critic`.
885
+
5. Make rich debugging for`go-critic` and meticulously validate `go-critic` checks config.
886
+
6. Update and use upstream versions of `unparam` and `interfacer` instead of forked ones.
887
+
7. Improve handling of unknown linter names in`//nolint` directives.
888
+
8. Speedup `typecheck` on large project with compilation errors.
889
+
9. Add support for searching for`errcheck` exclude file.
890
+
10. Fix `go-misc` checksum.
891
+
892
+
### December 2018
893
+
894
+
1. Update `goimports`: the new version creates named imports for name/path mismatches.
895
+
2. Update `go-critic` to the latest version.
896
+
3. Sync default `go-critic` checks list with the `go-critic`.
897
+
4. Support `pre-commit.com` hooks.
898
+
5. Rework and simplify `--skip-dirs`for some edge cases.
899
+
6. Add `modules-download-mode` option: it's useful in CI.
900
+
7. Better validate commands.
901
+
8. Fix working with absolute paths.
902
+
9. Fix `errcheck.ignore` option.
903
+
881
904
### November 2018
882
905
883
906
1. Support new linters:
@@ -955,7 +978,7 @@ There is the most valuable changes log:
955
978
## Contact Information
956
979
957
980
You can contact the [author](https://github.com/jirfag) of GolangCI-Lint
by [[email protected]](mailto:[email protected]). Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci).
GolangCI-Lint is a linters aggregator. It's fast: on average [5 times faster](#performance) than gometalinter.
7
-
It's [easy to integrate and use](#command-line-options), has [nice output](#quick-start) and has a minimum number of false positives.
7
+
It's [easy to integrate and use](#command-line-options), has [nice output](#quick-start) and has a minimum number of false positives. It supports go modules.
8
8
9
9
GolangCI-Lint has [integrations](#editor-integration) with VS Code, GNU Emacs, Sublime Text.
10
10
11
+
Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci).
12
+
11
13
Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running linters on Github pull requests. Free for Open Source.
(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win).)
98
+
99
+
(On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win). Or you can run just `go get -u github.com/golangci/golangci-lint/cmd/golangci-lint`.)
98
100
99
101
You can also install it on MacOS using [brew](https://brew.sh/):
100
102
@@ -298,15 +300,14 @@ Read [this section](#internals) for details.
298
300
We don't fork to call specific linter but use its API.
299
301
For small and medium projects 50-90% of work between linters can be reused.
300
302
301
-
* load `loader.Program` once
303
+
* load `[]*packages.Package` by `go/packages` once
302
304
303
305
We load program (parsing all files and type-checking) only once for all linters. For the most of linters
304
306
it's the most heavy operation: it takes 5 seconds on 8 kLoC repo and 11 seconds on `$GOROOT/src`.
305
307
* build `ssa.Program` once
306
308
307
309
Some linters (megacheck, interfacer, unparam) work on SSA representation.
308
310
Building of this representation takes 1.5 seconds on 8 kLoC repo and 6 seconds on `$GOROOT/src`.
309
-
`SSA` representation is used from a [fork of go-tools](https://github.com/dominikh/go-tools), not the official one.
310
311
311
312
* parse source code and build AST once
312
313
@@ -318,17 +319,11 @@ Read [this section](#internals) for details.
318
319
319
320
It takes 300-1000 ms for `$GOROOT/src`.
320
321
2. Smart linters scheduling
321
-
322
+
322
323
We schedule linters by a special algorithm which takes estimated execution time into account. It allows
323
324
to save 10-30% of time when one of heavy linters (megacheck etc) is enabled.
324
325
325
-
3. Improved program loading
326
-
327
-
We smartly use setting `TypeCheckFuncBodies` in `loader.Config` to build `loader.Program`.
328
-
If there are no linters requiring SSA enabled we can load dependencies of analyzed code much faster
329
-
by not analyzing their functions: we analyze only file-level declarations. It makes program loading
330
-
10-30% faster in such cases.
331
-
4. Don't fork to run shell commands
326
+
3. Don't fork to run shell commands
332
327
333
328
All linters are vendored in the `/vendor` folder: their version is fixed, they are builtin
334
329
and you don't need to install them separately.
@@ -435,13 +430,14 @@ You have 2 choices:
435
430
436
431
We don't recommend vendoring `golangci-lint` in your repo: you will get troubles updating `golangci-lint`. Please, use recommended way to install with the shell script: it's very fast.
437
432
438
-
**Does I need to run `go install`?**
433
+
**Do I need to run `go install`?**
439
434
440
435
No, you don't need to do it anymore.
441
436
442
437
**Which go versions are supported**
443
-
Golangci-lint versions > 1.10.2 supports Go 1.10 and 1.11.
444
-
Golangci-lint versions <= v1.10.2 supported Go 1.9, 1.10, 1.11.
438
+
Short answer: go 1.10 and newer are supported.
439
+
440
+
Long answer: golangci-lint > 1.10.2 supports Go 1.10 and 1.11; golangci-lint <= v1.10.2 supports Go 1.9, 1.10, 1.11.
445
441
446
442
**`golangci-lint` doesn't work**
447
443
@@ -455,6 +451,7 @@ Usually this options is used during development on local machine and compilation
455
451
456
452
## Thanks
457
453
454
+
Thanks to all [contributors](https://github.com/golangci/golangci-lint/graphs/contributors)!
458
455
Thanks to [alecthomas/gometalinter](https://github.com/alecthomas/gometalinter) for inspiration and amazing work.
459
456
Thanks to [bradleyfalzon/revgrep](https://github.com/bradleyfalzon/revgrep) for cool diff tool.
460
457
@@ -463,8 +460,34 @@ Thanks to developers and authors of used linters:
463
460
464
461
## Changelog
465
462
463
+
Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci).
466
464
There is the most valuable changes log:
467
465
466
+
### January 2019
467
+
468
+
1. Update `megacheck` (`staticcheck`) to the latest version: it consumes much less memory.
469
+
2. Support the new `stylecheck` linter.
470
+
3. Update `go-critic` to the latest version.
471
+
4. Support of `enabled-tags` options for `go-critic`.
472
+
5. Make rich debugging for `go-critic` and meticulously validate `go-critic` checks config.
473
+
6. Update and use upstream versions of `unparam` and `interfacer` instead of forked ones.
474
+
7. Improve handling of unknown linter names in `//nolint` directives.
475
+
8. Speedup `typecheck` on large project with compilation errors.
476
+
9. Add support for searching for `errcheck` exclude file.
477
+
10. Fix `go-misc` checksum.
478
+
479
+
### December 2018
480
+
481
+
1. Update `goimports`: the new version creates named imports for name/path mismatches.
482
+
2. Update `go-critic` to the latest version.
483
+
3. Sync default `go-critic` checks list with the `go-critic`.
484
+
4. Support `pre-commit.com` hooks.
485
+
5. Rework and simplify `--skip-dirs` for some edge cases.
486
+
6. Add `modules-download-mode` option: it's useful in CI.
487
+
7. Better validate commands.
488
+
8. Fix working with absolute paths.
489
+
9. Fix `errcheck.ignore` option.
490
+
468
491
### November 2018
469
492
470
493
1. Support new linters:
@@ -542,7 +565,7 @@ There is the most valuable changes log:
542
565
## Contact Information
543
566
544
567
You can contact the [author](https://github.com/jirfag) of GolangCI-Lint
by [[email protected]](mailto:[email protected]). Follow the news and releases on our [twitter](https://twitter.com/golangci) and our [blog](https://medium.com/golangci).
0 commit comments