detached 396bb02

chore(lint): add golangci-lint configuration

commit
396bb02847576bb9dcc4f8f4449ca5886eae1d18
author
brice · · 2026-08-05 04:22 UTC
committer
brice · · 2026-08-05 04:42 UTC
parent
dae7738
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
5 files · +50 -4
M .github/workflows/ci.yml +17 -0
@@ -46,3 +46,20 @@ jobs:
4646
4747 - name: go test
4848 run: go test -race ./...
49+
50+ lint:
51+ name: lint
52+ runs-on: ubuntu-latest
53+ steps:
54+ - uses: actions/checkout@v4
55+
56+ - name: set up go
57+ uses: actions/setup-go@v7
58+ with:
59+ go-version: "1.26"
60+ cache: true
61+
62+ - name: golangci-lint
63+ uses: golangci/golangci-lint-action@v9.3.0
64+ with:
65+ version: v2.12.2
@@ -46,3 +46,20 @@ jobs:
46 46
47 - name: go test47 - name: go test
48 run: go test -race ./...48 run: go test -race ./...
49+
50+ lint:
51+ name: lint
52+ runs-on: ubuntu-latest
53+ steps:
54+ - uses: actions/checkout@v4
55+
56+ - name: set up go
57+ uses: actions/setup-go@v7
58+ with:
59+ go-version: "1.26"
60+ cache: true
61+
62+ - name: golangci-lint
63+ uses: golangci/golangci-lint-action@v9.3.0
64+ with:
65+ version: v2.12.2
A .golangci.yml +19 -0
@@ -0,0 +1,19 @@
1+version: "2"
2+
3+run:
4+ timeout: 5m
5+ relative-path-mode: gomod
6+ modules-download-mode: readonly
7+
8+linters:
9+ default: standard
10+
11+formatters:
12+ enable:
13+ - gofmt
14+
15+issues:
16+ # Keep existing findings from blocking adoption while failing on new issues.
17+ new: true
18+ max-issues-per-linter: 0
19+ max-same-issues: 0
@@ -0,0 +1,19 @@
1+version: "2"
2+
3+run:
4+ timeout: 5m
5+ relative-path-mode: gomod
6+ modules-download-mode: readonly
7+
8+linters:
9+ default: standard
10+
11+formatters:
12+ enable:
13+ - gofmt
14+
15+issues:
16+ # Keep existing findings from blocking adoption while failing on new issues.
17+ new: true
18+ max-issues-per-linter: 0
19+ max-same-issues: 0
M CONTRIBUTING.md +3 -1
@@ -75,7 +75,8 @@ make install # install the current checkout with go install
7575 make go-install # install a published module version
7676 make test # run all tests with the race detector
7777 make test-fast # run all tests without the race detector
78-make lint # run go vet and verify gofmt
78+make lint # run golangci-lint, go vet, and verify gofmt
79+make lint-install # install the pinned golangci-lint version
7980 ```
8081
8182 Tests must not depend on real provider credentials, paid model calls, a developer's global zot state, or a specific terminal. Use local HTTP test servers, fixtures, temporary directories, and synthetic credentials.
@@ -133,6 +134,7 @@ Run focused package tests while developing. Before opening a pull request that c
133134 ```sh
134135 gofmt -w <changed-go-files>
135136 go vet ./...
137+golangci-lint run ./...
136138 go test -race ./...
137139 git diff --check
138140 ```
@@ -75,7 +75,8 @@ make install # install the current checkout with go install
75 make go-install # install a published module version75 make go-install # install a published module version
76 make test # run all tests with the race detector76 make test # run all tests with the race detector
77 make test-fast # run all tests without the race detector77 make test-fast # run all tests without the race detector
78-make lint # run go vet and verify gofmt78+make lint # run golangci-lint, go vet, and verify gofmt
79+make lint-install # install the pinned golangci-lint version
79 ```80 ```
80 81
81 Tests must not depend on real provider credentials, paid model calls, a developer's global zot state, or a specific terminal. Use local HTTP test servers, fixtures, temporary directories, and synthetic credentials.82 Tests must not depend on real provider credentials, paid model calls, a developer's global zot state, or a specific terminal. Use local HTTP test servers, fixtures, temporary directories, and synthetic credentials.
@@ -133,6 +134,7 @@ Run focused package tests while developing. Before opening a pull request that c
133 ```sh134 ```sh
134 gofmt -w <changed-go-files>135 gofmt -w <changed-go-files>
135 go vet ./...136 go vet ./...
137+golangci-lint run ./...
136 go test -race ./...138 go test -race ./...
137 git diff --check139 git diff --check
138 ```140 ```
M Makefile +9 -2
@@ -9,9 +9,11 @@ BIN_DIR ?= bin
99 DEV_VERSION ?= 0.0.0-dev
1010 VERSION ?= $(DEV_VERSION)
1111 GO_INSTALL_VERSION ?= latest
12+GOLANGCI_LINT ?= golangci-lint
13+GOLANGCI_LINT_VERSION ?= v2.12.2
1214 LDFLAGS := -s -w -X main.version=$(VERSION)
1315
14-.PHONY: help build install go-install test test-fast vet lint fmt-check fmt check run clean release
16+.PHONY: help build install go-install test test-fast vet lint lint-install fmt-check fmt check run clean release
1517
1618 help:
1719 @printf '%s\n' \
@@ -21,7 +23,8 @@ help:
2123 'test run all tests with the race detector' \
2224 'test-fast run all tests without the race detector' \
2325 'vet run go vet ./...' \
24- 'lint run vet and verify gofmt' \
26+ 'lint run golangci-lint, vet, and verify gofmt' \
27+ 'lint-install install golangci-lint $(GOLANGCI_LINT_VERSION)' \
2528 'fmt format Go source files' \
2629 'check run test-fast and lint' \
2730 'run build and run ./bin/zot (pass ARGS="...")' \
@@ -54,6 +57,10 @@ fmt-check:
5457 if [ -n "$$files" ]; then printf '%s\n' "$$files" >&2; echo "gofmt issues" >&2; exit 1; fi
5558
5659 lint: vet fmt-check
60+ $(GOLANGCI_LINT) run ./...
61+
62+lint-install:
63+ $(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
5764
5865 check: test-fast lint
5966
@@ -9,9 +9,11 @@ BIN_DIR ?= bin
9 DEV_VERSION ?= 0.0.0-dev9 DEV_VERSION ?= 0.0.0-dev
10 VERSION ?= $(DEV_VERSION)10 VERSION ?= $(DEV_VERSION)
11 GO_INSTALL_VERSION ?= latest11 GO_INSTALL_VERSION ?= latest
12+GOLANGCI_LINT ?= golangci-lint
13+GOLANGCI_LINT_VERSION ?= v2.12.2
12 LDFLAGS := -s -w -X main.version=$(VERSION)14 LDFLAGS := -s -w -X main.version=$(VERSION)
13 15
14-.PHONY: help build install go-install test test-fast vet lint fmt-check fmt check run clean release16+.PHONY: help build install go-install test test-fast vet lint lint-install fmt-check fmt check run clean release
15 17
16 help:18 help:
17 @printf '%s\n' \19 @printf '%s\n' \
@@ -21,7 +23,8 @@ help:
21 'test run all tests with the race detector' \23 'test run all tests with the race detector' \
22 'test-fast run all tests without the race detector' \24 'test-fast run all tests without the race detector' \
23 'vet run go vet ./...' \25 'vet run go vet ./...' \
24- 'lint run vet and verify gofmt' \26+ 'lint run golangci-lint, vet, and verify gofmt' \
27+ 'lint-install install golangci-lint $(GOLANGCI_LINT_VERSION)' \
25 'fmt format Go source files' \28 'fmt format Go source files' \
26 'check run test-fast and lint' \29 'check run test-fast and lint' \
27 'run build and run ./bin/zot (pass ARGS="...")' \30 'run build and run ./bin/zot (pass ARGS="...")' \
@@ -54,6 +57,10 @@ fmt-check:
54 if [ -n "$$files" ]; then printf '%s\n' "$$files" >&2; echo "gofmt issues" >&2; exit 1; fi57 if [ -n "$$files" ]; then printf '%s\n' "$$files" >&2; echo "gofmt issues" >&2; exit 1; fi
55 58
56 lint: vet fmt-check59 lint: vet fmt-check
60+ $(GOLANGCI_LINT) run ./...
61+
62+lint-install:
63+ $(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
57 64
58 check: test-fast lint65 check: test-fast lint
59 66
M README.md +2 -1
@@ -1043,7 +1043,8 @@ make help # list the important developer commands
10431043 make build # build ./bin/zot as 0.0.0-dev
10441044 make test # go test -race ./...
10451045 make test-fast # go test ./...
1046-make lint # go vet + gofmt check
1046+make lint # golangci-lint + go vet + gofmt check
1047+make lint-install # install the pinned golangci-lint version
10471048 make fmt # gofmt -w .
10481049 make install # install the current checkout with go install
10491050 make go-install # install the latest published module version
@@ -1043,7 +1043,8 @@ make help # list the important developer commands
1043 make build # build ./bin/zot as 0.0.0-dev1043 make build # build ./bin/zot as 0.0.0-dev
1044 make test # go test -race ./...1044 make test # go test -race ./...
1045 make test-fast # go test ./...1045 make test-fast # go test ./...
1046-make lint # go vet + gofmt check1046+make lint # golangci-lint + go vet + gofmt check
1047+make lint-install # install the pinned golangci-lint version
1047 make fmt # gofmt -w .1048 make fmt # gofmt -w .
1048 make install # install the current checkout with go install1049 make install # install the current checkout with go install
1049 make go-install # install the latest published module version1050 make go-install # install the latest published module version

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close