28 lines
1.0 KiB
Markdown
28 lines
1.0 KiB
Markdown
# go-lint
|
|
|
|
golangci-lint for every Go repository, with one shared configuration
|
|
(`golangci.yml` here) and one pinned version. Add it as a step after the tests:
|
|
|
|
```yaml
|
|
- name: Lint
|
|
uses: https://lab.zlymeda.dynu.net/actions/go-lint@master
|
|
```
|
|
|
|
It reports only issues in what the run brings: the pushed commits, or what a
|
|
pull request or a new branch adds to its target. A repository that was never
|
|
linted therefore does not go red, and its old code is cleaned as it is touched.
|
|
`new_from_rev: ''` reports everything, for a repository that is already clean.
|
|
|
|
A repository with its own `.golangci.yml` is linted with that instead, for rules
|
|
only it needs. Copy the shared file and add to it, so the common rules stay.
|
|
|
|
The version is the one baked into the go-executor image; another runner, or a
|
|
different `version`, installs it first. Bump both together.
|
|
|
|
Locally, with the same rules:
|
|
|
|
```sh
|
|
curl -sSfo /tmp/golangci.yml https://lab.zlymeda.dynu.net/actions/go-lint/raw/branch/master/golangci.yml
|
|
golangci-lint run --config /tmp/golangci.yml
|
|
```
|