Skip to content

Commit 08292ea

Browse files
committed
ci: enable golangci-lint
This also removes go vet and gofmt, as those are built into golangci-lint. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent c763162 commit 08292ea

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

.github/workflows/go.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,24 @@ jobs:
2424
uses: actions/setup-go@v5
2525
with:
2626
go-version: ${{ matrix.go }}
27-
- name: Go fmt
28-
run: ./scripts/ci-runner.sh go_fmt
2927
- name: Go build (source)
3028
run: ./scripts/ci-runner.sh build_source
3129
- name: Go build (tests)
3230
run: ./scripts/ci-runner.sh build_tests
33-
- name: Go vet
34-
run: ./scripts/ci-runner.sh go_vet
31+
lint:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Install dependencies
35+
run: |
36+
sudo apt-get -qq update
37+
sudo apt-get -qq install libsystemd-dev
38+
- uses: actions/checkout@v5
39+
- uses: actions/setup-go@v5
40+
with:
41+
go-version: stable
42+
- uses: golangci/golangci-lint-action@v8
43+
with:
44+
version: v2.3
3545

3646
all-done:
3747
needs:

.golangci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gofumpt
6+
7+
linters:
8+
settings:
9+
staticcheck:
10+
checks:
11+
- all
12+
- -ST1003 # https://staticcheck.dev/docs/checks/#ST1003 Should not use underscores in Go names.
13+
- -ST1005 # https://staticcheck.dev/docs/checks/#ST1005 Error strings should not be capitalized.
14+
govet:
15+
enable:
16+
- nilness
17+
exclusions:
18+
presets:
19+
- std-error-handling

0 commit comments

Comments
 (0)