Skip to content

Commit 4f02a67

Browse files
committed
fix(ci): update golangci-lint config for v2.3.0 compatibility
- Use skip-dirs instead of exclude-dirs in run section - Remove unsupported linters-settings section - Update to golangci-lint v2.3.0 - Keep codecov files and slug parameters as correct
1 parent 4761a9b commit 4f02a67

File tree

2 files changed

+6
-84
lines changed

2 files changed

+6
-84
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Run golangci-lint
3232
uses: golangci/golangci-lint-action@v8
3333
with:
34-
version: latest
34+
version: v2.3.0
3535
args: --timeout=5m
3636

3737
test:

.golangci.yml

Lines changed: 5 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,16 @@ version: "2"
44
run:
55
timeout: 5m
66
tests: false
7-
# Skip generated files
8-
skip-files:
9-
- ".*\\.pb\\.go$"
10-
- ".*\\.gen\\.go$"
11-
12-
issues:
13-
# Exclude directories from all linting
14-
exclude-dirs:
7+
# Skip these directories entirely
8+
skip-dirs:
159
- scripts
1610
- vendor
1711
- testdata
18-
12+
13+
issues:
1914
# Maximum issues to report
2015
max-issues-per-linter: 50
2116
max-same-issues: 10
22-
23-
# Don't hide multiple issues from the same file
24-
exclude-use-default: false
2517

2618
linters:
2719
enable:
@@ -57,74 +49,4 @@ linters:
5749
- gochecknoglobals # We use some globals
5850
- gochecknoinits # Init functions are sometimes needed
5951
- gomnd # Magic numbers are sometimes clear in context
60-
- wsl # Too opinionated about whitespace
61-
62-
linters-settings:
63-
govet:
64-
check-shadowing: true
65-
enable-all: true
66-
67-
errcheck:
68-
check-type-assertions: true
69-
check-blank: true
70-
exclude-functions:
71-
- (io.Closer).Close
72-
- (net/http.ResponseWriter).Write
73-
74-
staticcheck:
75-
checks: ["all"]
76-
77-
misspell:
78-
locale: US
79-
80-
goconst:
81-
min-len: 3
82-
min-occurrences: 3
83-
84-
gocyclo:
85-
min-complexity: 15
86-
87-
dupl:
88-
threshold: 100
89-
90-
gosec:
91-
excludes:
92-
- G204 # Subprocess launched with variable
93-
- G304 # File path provided as taint input
94-
95-
revive:
96-
confidence: 0.8
97-
rules:
98-
- name: blank-imports
99-
- name: context-as-argument
100-
- name: context-keys-type
101-
- name: dot-imports
102-
- name: error-return
103-
- name: error-strings
104-
- name: error-naming
105-
- name: exported
106-
- name: if-return
107-
- name: increment-decrement
108-
- name: var-naming
109-
- name: var-declaration
110-
- name: package-comments
111-
- name: range
112-
- name: receiver-naming
113-
- name: time-naming
114-
- name: unexported-return
115-
- name: indent-error-flow
116-
- name: errorf
117-
118-
godot:
119-
scope: all
120-
exclude:
121-
- "^fixme:"
122-
- "^todo:"
123-
124-
goimports:
125-
local-prefixes: github.com/agentstation/tokenizer
126-
127-
prealloc:
128-
simple: true
129-
range-loops: true
130-
for-loops: true
52+
- wsl # Too opinionated about whitespace

0 commit comments

Comments
 (0)