Skip to content

Commit 78ade26

Browse files
authored
docs: improve integrations and install pages (#4719)
1 parent 27355d9 commit 78ade26

File tree

4 files changed

+38
-28
lines changed

4 files changed

+38
-28
lines changed

docs/src/docs/welcome/annotations.png

-54.1 KB
Loading
69.9 KB
Loading

docs/src/docs/welcome/install.mdx

+30-23
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,28 @@ title: "Install"
66

77
Most installations of `golangci-lint` are performed for CI.
88

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+
915
### GitHub Actions
1016

1117
We recommend using [our GitHub Action](https://github.com/golangci/golangci-lint-action) for running `golangci-lint` in CI for GitHub projects.
18+
1219
It's [fast and uses smart caching](https://github.com/golangci/golangci-lint-action#performance) inside,
1320
and it can be much faster than the simple binary installation.
1421

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+
![Log output of the action](./colored-line-number.png)
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):
1625

1726
![GitHub annotations of the action](./annotations.png)
1827

1928
### Other CI
2029

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:
2831

2932
```sh
3033
# binary will be $(go env GOPATH)/bin/golangci-lint
@@ -55,23 +58,11 @@ golangci-lint --version
5558

5659
On Windows, you can run the above commands with Git Bash, which comes with [Git for Windows](https://git-scm.com/download/win).
5760

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
6862

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.
7364

74-
### macOS
65+
### MacOS
7566

7667
#### Brew
7768

@@ -123,6 +114,22 @@ scoop install main/golangci-lint
123114

124115
The scoop package is not officially maintained by golangci team.
125116

117+
### Docker
118+
119+
```sh
120+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
121+
```
122+
123+
Preserving cache between consecutive runs:
124+
```sh
125+
docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/{.LatestVersion}:/root/.cache -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
126+
```
127+
128+
Colored output:
129+
```sh
130+
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
131+
```
132+
126133
### Install from Source
127134

128135
Note: such `go install`/`go get` installation aren't guaranteed to work. We recommend using binary installation.

docs/src/docs/welcome/integrations.mdx

+8-5
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ There is a [plugin](https://github.com/SublimeLinter/SublimeLinter-golangcilint)
2626

2727
How to configure:
2828

29-
- Install [plugin](https://plugins.jetbrains.com/plugin/12496-go-linter)
29+
- Install [plugin](https://plugins.jetbrains.com/plugin/12496-go-linter).
3030
- Add [File Watcher](https://www.jetbrains.com/help/go/settings-tools-file-watchers.html) using existing `golangci-lint` template.
3131
- 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$`.
3232

@@ -35,15 +35,18 @@ How to configure:
3535
There are available plugins:
3636

3737
- [Spacemacs](https://github.com/syl20bnr/spacemacs/blob/develop/layers/+lang/go/README.org#linting)
38-
- [flycheck checker](https://github.com/weijiangan/flycheck-golangci-lint).
38+
- [Flycheck checker](https://github.com/weijiangan/flycheck-golangci-lint)
3939

4040
### Vim
4141

4242
The following plugins support `golangci-lint`:
4343

44-
- [vim-go](https://github.com/fatih/vim-go);
45-
- [ALE](https://github.com/w0rp/ale);
46-
- [Syntastic](https://github.com/vim-syntastic/syntastic).
44+
- [vim-go](https://github.com/fatih/vim-go)
45+
- [ALE](https://github.com/w0rp/ale)
46+
47+
### LSP Server
48+
49+
- [golangci-lint-langserver](https://github.com/nametake/golangci-lint-langserver) (NeoVim, Vim, Emacs, ...)
4750

4851
## Shell Completion
4952

0 commit comments

Comments
 (0)