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 is [fast](#performance)(2-7 times faster than gometalinter), [easy to integrate and use](#issues-options), has [nice output](#quick-start) and has minimum count of false positives.
4
+
GolangCI-Lint is a linters aggregator. It's fast (on average [5 times faster]((#performance) than gometalinter), [easy to integrate and use](#issues-options), has [nice output](#quick-start) and has minimum number of false positives.
5
5
6
6
Sponsored by [GolangCI.com](https://golangci.com): SaaS service for running linters on Github pull requests. Free for Open Source.
7
7
@@ -36,7 +36,7 @@ go get -u gopkg.in/golangci/golangci-lint.v1/cmd/golangci-lint
36
36
Example of output:
37
37

38
38
39
-
Short 2 min video demo.
39
+
Short 2 min video demo of analyzing [beego](https://github.com/astaxie/beego).
@@ -99,13 +99,13 @@ $ golangci-lint run --disable-all -E errcheck
99
99
GolangCI-Lint was created to fix next issues with `gometalinter`:
100
100
1. Slow work: `gometalinter` usually works for minutes in average projects. GolangCI-Lint works [2-7x times faster](#performance) by [reusing work](#internals).
101
101
2. Huge memory consumption: parallel linters don't share the same program representation and can eat `n` times more memory (`n` - concurrency). GolangCI-Lint fixes it by sharing representation.
102
-
3. Can't set honest concurrency: if you set it to `n` it can take `n+x` threads because of forced threads in specific linters. `gometalinter` can't do anything about it, because it runs linters as black-boxes in forked processes. In GolangCI-Lint we run all linters in one process and fully control them. Configured concurrency will be honest.
103
-
This issue is important because often you'd like to set concurrency to CPUs count minus one to save one CPU for example for IDE. If concurrency isn't correct you will have troubles using IDE while analyzing code.
102
+
3. Can't set honest concurrency: if you set it to `n` it can take up to `n*n` threads because of forced threads in specific linters. `gometalinter` can't do anything about it, because it runs linters as black-boxes in forked processes. In GolangCI-Lint we run all linters in one process and fully control them. Configured concurrency will be honest.
103
+
This issue is important because often you'd like to set concurrency to CPUs count minus one to not freeze your PC and be able to work on it while analyzing code.
104
104
4. Lack of nice output. We like how compilers `gcc` and `clang` format their warnings: using colors, printing of warned line and showing position in line.
105
105
5. Too many issues. GolangCI-Lint cuts a lot of issues by using default exclude list of common false-positives. Also it has enabled by default smart issues processing: merge multiple issues for one line, merge issues with the same text or from the same linter. All of these smart processors can be configured by user.
106
-
6.Installation. With `gometalinter` you need to run linters installation step. It's easy to forget this step and have stale linters.
107
-
7.Integration to large codebases. You can use `revgrep`, but it's yet another utility to install. With `golangci-lint` it's much easier: `revgrep` is already built into `golangci-lint`and you use it with one option (`-n, --new` or `--new-from-rev`).
108
-
8. Yaml or toml config. JSON isn't convenient for configuration files.
106
+
6.Integration to large codebases. Good way to start using linters in large project is not to fix all hundreds on existing issues, but setup CI and fix only issues in new commits. You can use `revgrep` for it, but it's yet another utility to install and configure. With `golangci-lint` it's much easier: `revgrep` is already built into `golangci-lint`and you can use it with one option (`-n, --new` or `--new-from-rev`).
107
+
7.Installation. With `gometalinter` you need to run linters installation step. It's easy to forget this step and have stale linters. It also complicates CI setup.
108
+
8. Yaml or toml config. Gometalinter's JSON isn't convenient for configuration files.
109
109
110
110
## `golangci-lint` vs Run Needed Linters Manually
111
111
1. It will be much slower because `golangci-lint` runs all linters in parallel and shares 50-80% of linters work.
@@ -316,12 +316,12 @@ issues:
316
316
```
317
317
318
318
# False Positives
319
-
False positives are inevitable, but we did our best to reduce their count. For example, we have a enabled by default set of [exclude patterns](#issues-options). If false postive occured you have next choices:
320
-
1. Exclude issue text using command-line option `-e` or config option `issues.exclude`. It's helpful when you decided to ignore all issues of this type.
319
+
False positives are inevitable, but we did our best to reduce their count. For example, we have an enabled by default set of [exclude patterns](#issues-options). If false postive occured you have next choices:
320
+
1. Exclude issue by text using command-line option `-e` or config option `issues.exclude`. It's helpful when you decided to ignore all issues of this type.
321
321
2. Exclude this one issue by using special comment `// nolint[:linter1,linter2,...]` on issued line.
322
322
Comment `// nolint` disables all issues reporting on this line. Comment e.g. `// nolint:govet` disables only govet issues for this line.
323
323
324
-
Please create [GitHub Issues here](https://github.com/golangci/golangci-lint/issues/new) about found false positives. We will add it to default exclude list if it's common or we will even fix underlying linter.
324
+
Please create [GitHub Issues here](https://github.com/golangci/golangci-lint/issues/new) about found false positives. We will add it to default exclude list if it's common or we will fix underlying linter.
325
325
326
326
# Internals
327
327
Key difference with gometalinter is that golangci-lint shares work between specific linters (golint, govet, ...).
@@ -360,7 +360,7 @@ A: You have 2 choices:
360
360
**Q: `golangci-lint` doesn't work**
361
361
1. Update it: `go get -u gopkg.in/golangci/golangci-lint.v1/cmd/golangci-lint`
362
362
2. Run it with `-v` option and check output.
363
-
3. If it doesn't help create [GitHub issue](https://github.com/golangci/golangci-lint/issues/new).
363
+
3. If it doesn't help create [GitHub issue](https://github.com/golangci/golangci-lint/issues/new) with output.
364
364
365
365
# Thanks
366
366
Thanks to [alecthomas/gometalinter](https://github.com/alecthomas/gometalinter) for inspiration and amazing work.
@@ -386,7 +386,7 @@ Thanks to developers and authors of used linters:
0 commit comments