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
Copy file name to clipboardExpand all lines: docs/src/docs/welcome/install.mdx
+30-23
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,28 @@ title: "Install"
6
6
7
7
Most installations of `golangci-lint` are performed for CI.
8
8
9
+
It's important to have reproducible CI: don't start to fail all builds at the same time.
10
+
With golangci-lint this can happen if you use option `--enable-all` and a new linter is added
11
+
or even without `--enable-all` when one upstream linter is upgraded.
12
+
13
+
**IMPORTANT**: It's highly recommended installing a specific version of golangci-lint available on the [releases page](https://github.com/golangci/golangci-lint/releases).
14
+
9
15
### GitHub Actions
10
16
11
17
We recommend using [our GitHub Action](https://github.com/golangci/golangci-lint-action) for running `golangci-lint` in CI for GitHub projects.
18
+
12
19
It's [fast and uses smart caching](https://github.com/golangci/golangci-lint-action#performance) inside,
13
20
and it can be much faster than the simple binary installation.
14
21
15
-
Also, the action creates GitHub annotations for found issues: you don't need to dig into build log to see found by `golangci-lint` issues:
22
+

23
+
24
+
Also, the action creates GitHub annotations for found issues (you don't need to dig into build log to see found by `golangci-lint` issues):
16
25
17
26

18
27
19
28
### Other CI
20
29
21
-
It's important to have reproducible CI: don't start to fail all builds at the same time.
22
-
With golangci-lint this can happen if you use option `--enable-all` and a new linter is added
23
-
or even without `--enable-all` when one upstream linter is upgraded.
24
-
25
-
**IMPORTANT**: It's highly recommended installing a specific version of golangci-lint available on the [releases page](https://github.com/golangci/golangci-lint/releases).
26
-
27
-
Here is the recommended way to install golangci-lint {.LatestVersion}:
30
+
Here is the other way to install golangci-lint:
28
31
29
32
```sh
30
33
# binary will be $(go env GOPATH)/bin/golangci-lint
@@ -55,23 +58,11 @@ golangci-lint --version
55
58
56
59
On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win).
57
60
58
-
### Docker
59
-
60
-
```sh
61
-
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
62
-
```
63
-
64
-
Preserving cache between consecutive runs:
65
-
```sh
66
-
docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/{.LatestVersion}:/root/.cache -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
67
-
```
61
+
### Linux
68
62
69
-
Colored output:
70
-
```sh
71
-
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
72
-
```
63
+
Golangci-lint is available inside the majority of the package managers.
- Add [File Watcher](https://www.jetbrains.com/help/go/settings-tools-file-watchers.html) using existing `golangci-lint` template.
31
31
- If your version of GoLand does not have the `golangci-lint`[File Watcher](https://www.jetbrains.com/help/go/settings-tools-file-watchers.html) template you can configure your own and use arguments `run --disable=typecheck $FileDir$`.
0 commit comments