Skip to content

Commit 8b4109e

Browse files
committed
fix: update golangci and fix lint errors
1 parent 5ce88b4 commit 8b4109e

File tree

6 files changed

+650
-631
lines changed

6 files changed

+650
-631
lines changed

.github/workflows/precommit.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
precommit:
1313
runs-on: ubuntu-latest
1414
container:
15-
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.2 # https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/.github
15+
image: quay.io/opendatahub/pre-commit-go-toolchain:v0.4
1616
env:
1717
XDG_CACHE_HOME: /cache
1818
GOCACHE: /cache/go-build
@@ -21,18 +21,13 @@ jobs:
2121
volumes:
2222
- /cache
2323
steps:
24-
- uses: actions/checkout@v4
25-
26-
- name: Set Go
27-
uses: actions/setup-go@v5
28-
with:
29-
go-version-file: './go.mod'
30-
24+
- uses: actions/checkout@v3
3125
- name: Activate cache
3226
uses: actions/cache@v4
3327
with:
3428
path: /cache
3529
key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum', '.pre-commit-config.yaml') }}
36-
30+
- name: Mark source directory as safe
31+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
3732
- name: Run pre-commit checks
38-
run: pre-commit run --all-files
33+
run: pre-commit run --all-files

.golangci.bck.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
run:
2+
timeout: 10m
3+
linters:
4+
enable:
5+
- errcheck
6+
- gosimple
7+
- govet
8+
- ineffassign
9+
- staticcheck
10+
- typecheck
11+
- unused

.golangci.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
run:
2-
timeout: 10m
1+
version: "2"
32
linters:
4-
enable:
5-
- errcheck
6-
- gosimple
7-
- govet
8-
- ineffassign
9-
- staticcheck
10-
- typecheck
11-
- unused
3+
exclusions:
4+
generated: lax
5+
presets:
6+
- comments
7+
- common-false-positives
8+
- legacy
9+
- std-error-handling
10+
paths:
11+
- third_party$
12+
- builtin$
13+
- examples$
14+
formatters:
15+
exclusions:
16+
generated: lax
17+
paths:
18+
- third_party$
19+
- builtin$
20+
- examples$

0 commit comments

Comments
 (0)