Skip to content

Commit da5690b

Browse files
authored
chore: update workflows (#105)
* chore: update workflows * chore: update to golangci-lint v2
1 parent d842a1d commit da5690b

File tree

4 files changed

+78
-73
lines changed

4 files changed

+78
-73
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
go: ['1.22', '1.23']
14+
go: [oldstable, stable]
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Set up Go

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
- name: Set up Go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: '1.23'
18+
go-version: stable
1919

2020
- name: Run golangci-lint
21-
uses: golangci/golangci-lint-action@v6.1.1
21+
uses: golangci/golangci-lint-action@v7
2222
with:
2323
version: latest

.github/workflows/tag.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Install Go
1313
uses: actions/setup-go@v5
1414
with:
15-
go-version: 1.23
15+
go-version: stable
1616
- name: Unshallow
1717
run: git fetch --prune --unshallow
1818
- name: Create release

.golangci.yml

+74-69
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,102 @@
1-
linters-settings:
2-
dupl:
3-
threshold: 100
4-
funlen:
5-
lines: 100
6-
statements: 50
7-
goconst:
8-
min-len: 2
9-
min-occurrences: 3
10-
gocritic:
11-
enabled-tags:
12-
- diagnostic
13-
- experimental
14-
- opinionated
15-
- performance
16-
- style
17-
disabled-checks:
18-
- whyNoLint
19-
gocyclo:
20-
min-complexity: 15
21-
goimports:
22-
local-prefixes: github.com/timonwong/loggercheck
23-
mnd:
24-
# don't include the "operation" and "assign"
25-
checks:
26-
- argument
27-
- case
28-
- condition
29-
- return
30-
ignored-numbers:
31-
- '0'
32-
- '1'
33-
- '2'
34-
- '3'
35-
ignored-functions:
36-
- strings.SplitN
37-
- strconv.ParseInt
38-
govet:
39-
shadow: true
40-
lll:
41-
line-length: 140
42-
misspell:
43-
locale: US
44-
nolintlint:
45-
allow-unused: false # report any unused nolint directives
46-
require-explanation: false # don't require an explanation for nolint directives
47-
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gofumpt
6+
- goimports
7+
settings:
8+
goimports:
9+
local-prefixes:
10+
- github.com/timonwong/loggercheck
11+
4812
linters:
49-
disable-all: true
13+
default: none
5014
enable:
5115
- bodyclose
16+
- copyloopvar
5217
- dogsled
5318
- dupl
5419
- errcheck
55-
- copyloopvar
5620
- funlen
5721
- gochecknoinits
5822
- goconst
5923
- gocritic
6024
- gocyclo
61-
- gofumpt
62-
- goimports
63-
- mnd
6425
- goprintffuncname
6526
- gosec
66-
- gosimple
6727
- govet
6828
- ineffassign
6929
- lll
7030
- misspell
31+
- mnd
7132
- nakedret
7233
- noctx
7334
- nolintlint
7435
- revive
7536
- staticcheck
76-
- stylecheck
77-
- typecheck
7837
- unconvert
7938
- unparam
8039
- unused
8140
- whitespace
8241

83-
issues:
84-
# Excluding configuration per-path, per-linter, per-text and per-source
85-
exclude-rules:
86-
- path: _test\.go
87-
linters:
88-
- mnd
89-
- path: internal/checkers/printf/printf.go
90-
linters:
91-
- gocritic
92-
exclude-dirs:
93-
- testdata
42+
settings:
43+
dupl:
44+
threshold: 100
45+
funlen:
46+
lines: 100
47+
statements: 50
48+
goconst:
49+
min-len: 2
50+
min-occurrences: 3
51+
gocritic:
52+
disabled-checks:
53+
- whyNoLint
54+
enabled-tags:
55+
- diagnostic
56+
- experimental
57+
- opinionated
58+
- performance
59+
- style
60+
gocyclo:
61+
min-complexity: 15
62+
govet:
63+
enable:
64+
- shadow
65+
lll:
66+
line-length: 140
67+
misspell:
68+
locale: US
69+
mnd:
70+
# don't include the "operation" and "assign"
71+
checks:
72+
- argument
73+
- case
74+
- condition
75+
- return
76+
ignored-numbers:
77+
- "0"
78+
- "1"
79+
- "2"
80+
- "3"
81+
ignored-functions:
82+
- strings.SplitN
83+
- strconv.ParseInt
84+
nolintlint:
85+
require-explanation: false # don't require an explanation for nolint directives
86+
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
87+
allow-unused: false # report any unused nolint directives
9488

95-
run:
96-
timeout: 5m
97-
go: '1.23'
89+
exclusions:
90+
presets:
91+
- comments
92+
- common-false-positives
93+
- legacy
94+
- std-error-handling
95+
# Excluding configuration per-path, per-linter, per-text and per-source
96+
rules:
97+
- linters:
98+
- mnd
99+
path: _test\.go
100+
- linters:
101+
- gocritic
102+
path: internal/checkers/printf/printf.go

0 commit comments

Comments
 (0)