Skip to content

Commit bf0c8a5

Browse files
committed
chore: dependabot, golangci
1 parent dfc43da commit bf0c8a5

3 files changed

Lines changed: 76 additions & 12 deletions

File tree

.github/dependabot.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for Go modules
4+
- package-ecosystem: "gomod"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
open-pull-requests-limit: 10
9+
labels:
10+
- "dependencies"
11+
- "go"
12+
groups:
13+
k8s-deps:
14+
patterns:
15+
- "k8s.io/*"
16+
- "sigs.k8s.io/*"
17+
update-types:
18+
- "minor"
19+
- "patch"
20+
go-deps:
21+
patterns:
22+
- "github.com/*"
23+
update-types:
24+
- "minor"
25+
- "patch"
26+
27+
# Maintain dependencies for GitHub Actions
28+
- package-ecosystem: "github-actions"
29+
directory: "/"
30+
schedule:
31+
interval: "weekly"
32+
open-pull-requests-limit: 10
33+
labels:
34+
- "dependencies"
35+
- "github-actions"

.github/workflows/lint.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@ name: Lint
22

33
on:
44
push:
5+
branches: [ main ]
56
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
611

712
jobs:
8-
lint:
9-
name: Run on Ubuntu
13+
golangci:
14+
name: lint
1015
runs-on: ubuntu-latest
1116
steps:
12-
- name: Clone the code
13-
uses: actions/checkout@v4
14-
15-
- name: Setup Go
16-
uses: actions/setup-go@v5
17+
- uses: actions/checkout@v3
18+
19+
- uses: actions/setup-go@v4
1720
with:
18-
go-version: '~1.22'
19-
20-
- name: Run linter
21-
uses: golangci/golangci-lint-action@v6
21+
go-version-file: 'go.mod'
22+
cache: true
23+
24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@v3
2226
with:
23-
version: v1.59
27+
version: v1.59.1
28+
args: --timeout=10m

.golangci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
run:
22
timeout: 5m
33
allow-parallel-runners: true
4+
# Skip test directories for certain linters to avoid Ginkgo framework related issues
5+
skip-dirs-use-default: true
6+
skip-files:
7+
- ".*_test.go$"
48

59
issues:
610
# don't skip warning about doc comments
@@ -16,6 +20,23 @@ issues:
1620
linters:
1721
- dupl
1822
- lll
23+
# Exclude test files from certain linters
24+
- path: "_test\\.go"
25+
linters:
26+
- typecheck
27+
- revive
28+
- gocyclo
29+
# Specifically handle test utils that use Ginkgo
30+
- path: "test/utils/*"
31+
linters:
32+
- typecheck
33+
- path: "test/e2e/*"
34+
linters:
35+
- typecheck
36+
- path: "internal/controller/*_test.go"
37+
linters:
38+
- typecheck
39+
1940
linters:
2041
disable-all: true
2142
enable:
@@ -45,3 +66,6 @@ linters-settings:
4566
revive:
4667
rules:
4768
- name: comment-spacings
69+
typecheck:
70+
# Enable skipping errors related to unresolved imports, which helps when using Ginkgo
71+
skip-unresolved: true

0 commit comments

Comments
 (0)