Skip to content

Commit 6db0f73

Browse files
committed
ci: Add golangci-lint
1 parent 9d9f015 commit 6db0f73

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,3 @@ jobs:
1919
run: test -z $(go fmt ./...)
2020
- name: Test
2121
run: go test -v ./...
22-
staticcheck:
23-
name: "Run staticcheck"
24-
runs-on: ubuntu-latest
25-
steps:
26-
- name: Checkout code
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
28-
- uses: dominikh/staticcheck-action@fe1dd0c3658873b46f8c9bb3291096a617310ca6
29-
with:
30-
version: "latest"

.github/workflows/lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: golangci-lint
2+
on: [push, pull_request]
3+
permissions: read-all
4+
jobs:
5+
golangci:
6+
name: lint
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
10+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
11+
with:
12+
go-version: '1.24'
13+
cache: true
14+
- name: golangci-lint
15+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
16+
with:
17+
version: latest

.golangci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: "2"
2+
run:
3+
issues-exit-code: 1
4+
linters:
5+
enable:
6+
- asciicheck
7+
- errorlint
8+
- gocritic
9+
- gosec
10+
- importas
11+
- misspell
12+
- prealloc
13+
- revive
14+
- staticcheck
15+
- tparallel
16+
- unconvert
17+
- unparam
18+
- whitespace
19+
exclusions:
20+
generated: lax
21+
presets:
22+
- comments
23+
- common-false-positives
24+
- legacy
25+
- std-error-handling
26+
issues:
27+
uniq-by-line: false
28+
formatters:
29+
enable:
30+
- gofmt
31+
- goimports
32+
exclusions:
33+
generated: lax

0 commit comments

Comments
 (0)