detached e81db1c

fix(lint): migrate golangci-lint config to v2 schema

commit
e81db1c93af2eb8ff2063b802fa744ea5c3a46d4
author
bnema · · 2025-11-29 18:56 UTC
parent
60a1be3
signature
unsigned
1 file · +107 -116
M .golangci.yml +107 -116
@@ -3,126 +3,117 @@ version: "2"
33 linters:
44 default: none
55 enable:
6- - bodyclose # checks whether HTTP response body is closed successfully
7- - copyloopvar # detects places where loop variables are copied
8-# - depguard # checks for unwanted dependencies (disabled for CLI apps)
9- - dogsled # checks assignments with too many blank identifiers
10- - dupl # tool for code clone detection
11- - errcheck # checking for unchecked errors
12- - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme
13- - funlen # tool for detection of long functions
14- - gocheckcompilerdirectives # validates go compiler directive comments (//go:)
15-# - gochecknoinits # checks that no init functions are present in Go code (disabled for CLI apps)
16- - goconst # finds repeated strings that could be replaced by a constant
17- - gocritic # provides diagnostics that check for bugs, performance and style issues
18- - gocyclo # computes and checks the cyclomatic complexity of functions
19- - godox # tool for detection of FIXME, TODO and other comment keywords
20- - mnd # detects magic numbers
21- - goprintffuncname # checks that printf-like functions are named with `f` at the end
22- - gosec # inspects source code for security problems
23- - govet # examines Go source code and reports suspicious constructs
24- - ineffassign # detects when assignments to existing variables are not used
25- - lll # reports long lines
26- - misspell # finds commonly misspelled English words in comments
27- - nakedret # finds naked returns in functions greater than a specified function length
28- - nolintlint # reports ill-formed or insufficient nolint directives
29- - revive # fast, configurable, extensible, flexible, and beautiful linter for Go
30- - staticcheck # advanced Go linter
31- - testifylint # checks usage of github.com/stretchr/testify
32- - unconvert # removes unnecessary type conversions
33- - unparam # reports unused function parameters
34- - unused # checks for unused constants, variables, functions and types
35- - whitespace # detects leading and trailing whitespace
6+ - bodyclose
7+ - copyloopvar
8+ - dogsled
9+ - dupl
10+ - errcheck
11+ - errorlint
12+ - funlen
13+ - gocheckcompilerdirectives
14+ - goconst
15+ - gocritic
16+ - gocyclo
17+ - godox
18+ - mnd
19+ - goprintffuncname
20+ - gosec
21+ - govet
22+ - ineffassign
23+ - lll
24+ - misspell
25+ - nakedret
26+ - nolintlint
27+ - revive
28+ - staticcheck
29+ - testifylint
30+ - unconvert
31+ - unparam
32+ - unused
33+ - whitespace
3634
37-linters-settings:
38- dupl:
39- threshold: 100
40- funlen:
41- lines: -1 # don't check line count
42- statements: 50
43- goconst:
44- min-len: 2
45- min-occurrences: 3
46- gocritic:
47- enabled-tags:
48- - diagnostic
49- - experimental
50- - opinionated
51- - performance
52- - style
53- disabled-checks:
54- - dupImport
55- - ifElseChain
56- - octalLiteral
57- - whyNoLint
58- gocyclo:
59- min-complexity: 15
60- godox:
61- keywords:
62- - FIXME
63- - TODO
64- - BUG
65- mnd:
66- checks:
67- - argument
68- - case
69- - condition
70- - return
71- ignored-numbers:
72- - '0'
73- - '1'
74- - '2'
75- - '3'
76- ignored-functions:
77- - strings.SplitN
78- govet:
79- enable:
80- - nilness
81- - shadow
82- errorlint:
83- asserts: false
84- lll:
85- line-length: 120
86- misspell:
87- locale: US
88- nolintlint:
89- allow-unused: false
90- require-explanation: true
91- require-specific: true
92- revive:
93- rules:
94- - name: indent-error-flow
95- - name: unused-parameter
96- - name: unused-receiver
35+ settings:
36+ dupl:
37+ threshold: 100
38+ funlen:
39+ lines: -1
40+ statements: 50
41+ goconst:
42+ min-len: 2
43+ min-occurrences: 3
44+ gocritic:
45+ enabled-tags:
46+ - diagnostic
47+ - experimental
48+ - opinionated
49+ - performance
50+ - style
51+ disabled-checks:
52+ - dupImport
53+ - ifElseChain
54+ - octalLiteral
55+ - whyNoLint
56+ gocyclo:
57+ min-complexity: 15
58+ godox:
59+ keywords:
60+ - FIXME
61+ - TODO
62+ - BUG
63+ mnd:
64+ checks:
65+ - argument
66+ - case
67+ - condition
68+ - return
69+ ignored-numbers:
70+ - '0'
71+ - '1'
72+ - '2'
73+ - '3'
74+ ignored-functions:
75+ - strings.SplitN
76+ govet:
77+ enable:
78+ - nilness
79+ - shadow
80+ errorlint:
81+ asserts: false
82+ lll:
83+ line-length: 120
84+ misspell:
85+ locale: US
86+ nolintlint:
87+ allow-unused: false
88+ require-explanation: true
89+ require-specific: true
90+ revive:
91+ rules:
92+ - name: indent-error-flow
93+ - name: unused-parameter
94+ - name: unused-receiver
9795
98-issues:
99- exclude-rules:
100- # Exclude some linters from running on tests files
101- - path: _test\.go
102- linters:
103- - dupl
104- - mnd
105- - lll
106- - funlen
107-
108- # Exclude SQLC generated files from linting
109- - path: internal/db/.*\.sql\.go
110- linters:
111- - all
112-
113- # Exclude SQLC generated models from some linters
114- - path: internal/db/models\.go
115- linters:
116- - unused
117- - deadcode
118-
119- # Allow long lines in generated code
120- - path: internal/db/
121- linters:
122- - lll
96+ exclusions:
97+ generated: lax
98+ rules:
99+ - path: _test\.go
100+ linters:
101+ - dupl
102+ - mnd
103+ - lll
104+ - funlen
105+ - path: internal/db/.*\.sql\.go
106+ linters:
107+ - all
108+ - path: internal/db/models\.go
109+ linters:
110+ - unused
111+ - path: internal/db/
112+ linters:
113+ - lll
123114
124115 run:
125116 timeout: 5m
126117 modules-download-mode: readonly
127118 build-tags:
128- - webkit_cgo⏎̸
119+ - webkit_cgo
@@ -3,126 +3,117 @@ version: "2"
3 linters:3 linters:
4 default: none4 default: none
5 enable:5 enable:
6- - bodyclose # checks whether HTTP response body is closed successfully6+ - bodyclose
7- - copyloopvar # detects places where loop variables are copied7+ - copyloopvar
8-# - depguard # checks for unwanted dependencies (disabled for CLI apps)8+ - dogsled
9- - dogsled # checks assignments with too many blank identifiers9+ - dupl
10- - dupl # tool for code clone detection10+ - errcheck
11- - errcheck # checking for unchecked errors11+ - errorlint
12- - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme12+ - funlen
13- - funlen # tool for detection of long functions13+ - gocheckcompilerdirectives
14- - gocheckcompilerdirectives # validates go compiler directive comments (//go:)14+ - goconst
15-# - gochecknoinits # checks that no init functions are present in Go code (disabled for CLI apps)15+ - gocritic
16- - goconst # finds repeated strings that could be replaced by a constant16+ - gocyclo
17- - gocritic # provides diagnostics that check for bugs, performance and style issues17+ - godox
18- - gocyclo # computes and checks the cyclomatic complexity of functions18+ - mnd
19- - godox # tool for detection of FIXME, TODO and other comment keywords19+ - goprintffuncname
20- - mnd # detects magic numbers20+ - gosec
21- - goprintffuncname # checks that printf-like functions are named with `f` at the end21+ - govet
22- - gosec # inspects source code for security problems22+ - ineffassign
23- - govet # examines Go source code and reports suspicious constructs23+ - lll
24- - ineffassign # detects when assignments to existing variables are not used24+ - misspell
25- - lll # reports long lines25+ - nakedret
26- - misspell # finds commonly misspelled English words in comments26+ - nolintlint
27- - nakedret # finds naked returns in functions greater than a specified function length27+ - revive
28- - nolintlint # reports ill-formed or insufficient nolint directives28+ - staticcheck
29- - revive # fast, configurable, extensible, flexible, and beautiful linter for Go29+ - testifylint
30- - staticcheck # advanced Go linter30+ - unconvert
31- - testifylint # checks usage of github.com/stretchr/testify31+ - unparam
32- - unconvert # removes unnecessary type conversions32+ - unused
33- - unparam # reports unused function parameters33+ - whitespace
34- - unused # checks for unused constants, variables, functions and types
35- - whitespace # detects leading and trailing whitespace
36 34
37-linters-settings:35+ settings:
38- dupl:36+ dupl:
39- threshold: 10037+ threshold: 100
40- funlen:38+ funlen:
41- lines: -1 # don't check line count39+ lines: -1
42- statements: 5040+ statements: 50
43- goconst:41+ goconst:
44- min-len: 242+ min-len: 2
45- min-occurrences: 343+ min-occurrences: 3
46- gocritic:44+ gocritic:
47- enabled-tags:45+ enabled-tags:
48- - diagnostic46+ - diagnostic
49- - experimental47+ - experimental
50- - opinionated48+ - opinionated
51- - performance49+ - performance
52- - style50+ - style
53- disabled-checks:51+ disabled-checks:
54- - dupImport52+ - dupImport
55- - ifElseChain53+ - ifElseChain
56- - octalLiteral54+ - octalLiteral
57- - whyNoLint55+ - whyNoLint
58- gocyclo:56+ gocyclo:
59- min-complexity: 1557+ min-complexity: 15
60- godox:58+ godox:
61- keywords:59+ keywords:
62- - FIXME60+ - FIXME
63- - TODO61+ - TODO
64- - BUG62+ - BUG
65- mnd:63+ mnd:
66- checks:64+ checks:
67- - argument65+ - argument
68- - case66+ - case
69- - condition67+ - condition
70- - return68+ - return
71- ignored-numbers:69+ ignored-numbers:
72- - '0'70+ - '0'
73- - '1'71+ - '1'
74- - '2'72+ - '2'
75- - '3'73+ - '3'
76- ignored-functions:74+ ignored-functions:
77- - strings.SplitN75+ - strings.SplitN
78- govet:76+ govet:
79- enable:77+ enable:
80- - nilness78+ - nilness
81- - shadow79+ - shadow
82- errorlint:80+ errorlint:
83- asserts: false81+ asserts: false
84- lll:82+ lll:
85- line-length: 12083+ line-length: 120
86- misspell:84+ misspell:
87- locale: US85+ locale: US
88- nolintlint:86+ nolintlint:
89- allow-unused: false87+ allow-unused: false
90- require-explanation: true88+ require-explanation: true
91- require-specific: true89+ require-specific: true
92- revive:90+ revive:
93- rules:91+ rules:
94- - name: indent-error-flow92+ - name: indent-error-flow
95- - name: unused-parameter93+ - name: unused-parameter
96- - name: unused-receiver94+ - name: unused-receiver
97 95
98-issues:96+ exclusions:
99- exclude-rules:97+ generated: lax
100- # Exclude some linters from running on tests files98+ rules:
101- - path: _test\.go99+ - path: _test\.go
102- linters:100+ linters:
103- - dupl101+ - dupl
104- - mnd102+ - mnd
105- - lll103+ - lll
106- - funlen104+ - funlen
107- 105+ - path: internal/db/.*\.sql\.go
108- # Exclude SQLC generated files from linting106+ linters:
109- - path: internal/db/.*\.sql\.go107+ - all
110- linters:108+ - path: internal/db/models\.go
111- - all109+ linters:
112- 110+ - unused
113- # Exclude SQLC generated models from some linters111+ - path: internal/db/
114- - path: internal/db/models\.go112+ linters:
115- linters:113+ - lll
116- - unused
117- - deadcode
118-
119- # Allow long lines in generated code
120- - path: internal/db/
121- linters:
122- - lll
123 114
124 run:115 run:
125 timeout: 5m116 timeout: 5m
126 modules-download-mode: readonly117 modules-download-mode: readonly
127 build-tags:118 build-tags:
128- - webkit_cgo⏎̸119+ - webkit_cgo

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 8

Tags 42

↑↓ moveenter openesc close