Skip to content

Commit f28e0b2

Browse files
committed
chore: add .golangci.yml to exclude generated oapi-codegen files from linting
1 parent 237f1da commit f28e0b2

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/lint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
permissions:
1010
contents: read
11+
1112
jobs:
1213
golangci:
1314
strategy:
@@ -20,12 +21,18 @@ jobs:
2021
- uses: actions/setup-go@v4
2122
with:
2223
go-version: ${{ matrix.go-version }}
24+
2325
- uses: actions/checkout@v4
26+
2427
- name: golangci-lint
2528
uses: golangci/golangci-lint-action@v3
2629
with:
2730
version: v1.54
31+
32+
- name: verify go modules
33+
run: go mod tidy && git diff --exit-code go.mod go.sum
34+
2835
- name: gofmt
2936
run: |
3037
go fmt ./...
31-
git diff --exit-code
38+
git diff --exit-code

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ issues:
77
exclude-files:
88
- "rest/gen/.*\\.go$"
99
- ".*\\.gen\\.go$"
10+
11+
# make errcheck a bit more lenient on common generated patterns
12+
linters-settings:
13+
errcheck:
14+
ignore: 'json:Unmarshal'

0 commit comments

Comments
 (0)