Lint every Go repository with one shared configuration and version, reporting only what a change brings

This commit is contained in:
meda committed 2026-10-28 10:22:42 +01:00
commit 89089b1e2f
3 files changed
+193

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
# 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
```