Skip to content

Commit 53f371f

Browse files
authored
ci: update golangci-lint configuration (#40)
1 parent cb3ec9e commit 53f371f

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: golangci-lint
2+
23
on:
34
push:
45
branches:
5-
- master
6+
- '**'
67
pull_request:
8+
branches:
9+
- master
10+
11+
permissions:
12+
contents: read
713

814
jobs:
915
golangci:
@@ -13,5 +19,16 @@ jobs:
1319
- name: Checkout code
1420
uses: actions/checkout@v4
1521

16-
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v4
22+
- name: Get go version from go.mod
23+
run: |
24+
echo "GO_VERSION=$(grep '^go ' go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
25+
26+
- name: Setup-go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: ${{ env.GO_VERSION }}
30+
31+
- name: Run golangci-lint
32+
uses: golangci/golangci-lint-action@v6
33+
with:
34+
version: v1.60.3

.golangci.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,53 @@
11
run:
2-
skip-dirs:
3-
- benchmarks
2+
timeout: 2m
43

54
linters:
65
disable-all: true
76
enable:
87
- dupl
98
- errcheck
10-
- exportloopref
9+
- errname
10+
- errorlint
1111
- funlen
12+
- gci
1213
- goconst
1314
- gocritic
1415
- gocyclo
1516
- gofmt
1617
- goimports
18+
- gosec
1719
- gosimple
1820
- govet
1921
- ineffassign
2022
- lll
2123
- misspell
24+
- nolintlint
2225
- prealloc
2326
- revive
2427
- staticcheck
28+
- stylecheck
29+
- thelper
30+
- tparallel
2531
- typecheck
2632
- unconvert
33+
- unparam
34+
- unused
35+
- whitespace
36+
37+
linters-settings:
38+
gosec:
39+
excludes:
40+
- G115
41+
thelper:
42+
test:
43+
begin: false
2744

2845
issues:
2946
exclude-rules:
30-
# Exclude some linters from running on tests files.
3147
- path: _test\.go
3248
linters:
3349
- errcheck
50+
- funlen
51+
52+
exclude-dirs:
53+
- benchmarks

value_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/reugn/async/internal/util"
88
)
99

10-
//nolint:funlen
1110
func TestValueCompareAndSwap(t *testing.T) {
1211
var value Value
1312
swapped := value.CompareAndSwap(1, 2)

0 commit comments

Comments
 (0)