Skip to content

Commit 00a5538

Browse files
committed
add modernize step to lint workflow
Signed-off-by: sivchari <shibuuuu5@gmail.com>
1 parent 47df1b5 commit 00a5538

File tree

694 files changed

+74971
-8770
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

694 files changed

+74971
-8770
lines changed

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v2.0.2
1+
version: v2.1.5
22
name: golangci-kube-api-linter
33
destination: ./bin
44
plugins:
Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: golangci-lint
1+
name: lint
22
on:
33
push:
44
branches:
@@ -11,15 +11,25 @@ permissions:
1111
# pull-requests: read
1212

1313
jobs:
14-
golangci:
15-
name: lint
14+
lint:
15+
name: golangci-lint
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: actions/setup-go@v5
2020
with:
2121
go-version-file: 'go.mod'
2222
- name: golangci-lint
23-
uses: golangci/golangci-lint-action@v7
23+
run: |
24+
make lint
25+
modernize:
26+
name: modernize
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-go@v5
2431
with:
25-
version: v2.0.2
32+
go-version-file: 'go.mod'
33+
- name: modernize
34+
run: |
35+
make modernize

Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
2-
GOLANGCI_LINT = go run ${PROJECT_DIR}/vendor/github.com/golangci/golangci-lint/v2/cmd/golangci-lint
32

43
VERSION ?= $(shell git describe --always --abbrev=7)
54

5+
MODERNIZE_VERSION ?= 0.18.1
6+
67
.PHONY: all
78
all: build
89

@@ -41,11 +42,19 @@ vendor: ## Ensure the vendor directory is up to date.
4142

4243
.PHONY: lint
4344
lint: ## Run golangci-lint over the codebase.
44-
${GOLANGCI_LINT} run ./... --timeout 5m -v
45+
go tool golangci-lint run ./... --timeout 5m -v
4546

4647
.PHONY: lint-fix
4748
lint-fix: ## Run golangci-lint over the codebase and run auto-fixers if supported by the linter
48-
${GOLANGCI_LINT} run ./... --timeout 5m -v --fix
49+
go tool golangci-lint run ./../... --timeout 5m -v --fix
50+
51+
.PHONY: modernize
52+
modernize: ## Run modernize on the codebase.
53+
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v${MODERNIZE_VERSION} -diff ./...
54+
55+
.PHONY: modernize-fix
56+
modernize-fix: ## Run modernize on the codebase and apply fixes.
57+
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@v${MODERNIZE_VERSION} -fix ./...
4958

5059
.PHONY: test
5160
test: fmt vet unit ## Run tests.
@@ -58,7 +67,7 @@ unit: ## Run unit tests.
5867

5968
.PHONY: build
6069
build: ## Build the golangci-lint custom plugin binary.
61-
${GOLANGCI_LINT} custom
70+
go tool golangci-lint custom
6271

6372
.PHONY: verify-%
6473
verify-%:

go.mod

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ module sigs.k8s.io/kube-api-linter
22

33
go 1.24.2
44

5+
tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint
6+
57
require (
6-
github.com/golangci/golangci-lint/v2 v2.0.2
78
github.com/golangci/plugin-module-register v0.1.1
8-
github.com/onsi/ginkgo/v2 v2.22.2
9-
github.com/onsi/gomega v1.36.2
9+
github.com/onsi/ginkgo/v2 v2.23.3
10+
github.com/onsi/gomega v1.36.3
1011
golang.org/x/tools v0.32.0
1112
k8s.io/apimachinery v0.32.3
1213
)
@@ -18,28 +19,28 @@ require (
1819
github.com/Abirdcfly/dupword v0.1.3 // indirect
1920
github.com/Antonboom/errname v1.1.0 // indirect
2021
github.com/Antonboom/nilnil v1.1.0 // indirect
21-
github.com/Antonboom/testifylint v1.6.0 // indirect
22+
github.com/Antonboom/testifylint v1.6.1 // indirect
2223
github.com/BurntSushi/toml v1.5.0 // indirect
23-
github.com/Crocmagnon/fatcontext v0.7.1 // indirect
2424
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
2525
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.1 // indirect
2626
github.com/Masterminds/semver/v3 v3.3.1 // indirect
2727
github.com/OpenPeeDeeP/depguard/v2 v2.2.1 // indirect
28+
github.com/alecthomas/chroma/v2 v2.16.0 // indirect
2829
github.com/alecthomas/go-check-sumtype v0.3.1 // indirect
29-
github.com/alexkohler/nakedret/v2 v2.0.5 // indirect
30+
github.com/alexkohler/nakedret/v2 v2.0.6 // indirect
3031
github.com/alexkohler/prealloc v1.0.0 // indirect
3132
github.com/alingse/asasalint v0.0.11 // indirect
32-
github.com/alingse/nilnesserr v0.1.2 // indirect
33+
github.com/alingse/nilnesserr v0.2.0 // indirect
3334
github.com/ashanbrown/forbidigo v1.6.0 // indirect
3435
github.com/ashanbrown/makezero v1.2.0 // indirect
3536
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
3637
github.com/beorn7/perks v1.0.1 // indirect
3738
github.com/bkielbasa/cyclop v1.2.3 // indirect
3839
github.com/blizzy78/varnamelen v0.8.0 // indirect
39-
github.com/bombsimon/wsl/v4 v4.6.0 // indirect
40+
github.com/bombsimon/wsl/v4 v4.7.0 // indirect
4041
github.com/breml/bidichk v0.3.3 // indirect
4142
github.com/breml/errchkjson v0.4.1 // indirect
42-
github.com/butuzov/ireturn v0.3.1 // indirect
43+
github.com/butuzov/ireturn v0.4.0 // indirect
4344
github.com/butuzov/mirror v1.3.0 // indirect
4445
github.com/catenacyber/perfsprint v0.9.1 // indirect
4546
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
@@ -57,13 +58,14 @@ require (
5758
github.com/dave/dst v0.27.3 // indirect
5859
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5960
github.com/denis-tingaikin/go-header v0.5.0 // indirect
61+
github.com/dlclark/regexp2 v1.11.5 // indirect
6062
github.com/ettle/strcase v0.2.0 // indirect
6163
github.com/fatih/color v1.18.0 // indirect
6264
github.com/fatih/structtag v1.2.0 // indirect
63-
github.com/firefart/nonamedreturns v1.0.5 // indirect
65+
github.com/firefart/nonamedreturns v1.0.6 // indirect
6466
github.com/fsnotify/fsnotify v1.5.4 // indirect
6567
github.com/fzipp/gocyclo v0.6.0 // indirect
66-
github.com/ghostiam/protogetter v0.3.12 // indirect
68+
github.com/ghostiam/protogetter v0.3.15 // indirect
6769
github.com/go-critic/go-critic v0.13.0 // indirect
6870
github.com/go-logr/logr v1.4.2 // indirect
6971
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
@@ -82,10 +84,11 @@ require (
8284
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32 // indirect
8385
github.com/golangci/go-printf-func-name v0.1.0 // indirect
8486
github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect
87+
github.com/golangci/golangci-lint/v2 v2.1.5 // indirect
8588
github.com/golangci/golines v0.0.0-20250217134842-442fd0091d95 // indirect
8689
github.com/golangci/misspell v0.6.0 // indirect
8790
github.com/golangci/revgrep v0.8.0 // indirect
88-
github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect
91+
github.com/golangci/unconvert v0.0.0-20250410112200-a129a6e6413e // indirect
8992
github.com/google/go-cmp v0.7.0 // indirect
9093
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
9194
github.com/gordonklaus/ineffassign v0.1.0 // indirect
@@ -99,33 +102,34 @@ require (
99102
github.com/hashicorp/hcl v1.0.0 // indirect
100103
github.com/hexops/gotextdiff v1.0.3 // indirect
101104
github.com/inconshreveable/mousetrap v1.1.0 // indirect
102-
github.com/jgautheron/goconst v1.7.1 // indirect
105+
github.com/jgautheron/goconst v1.8.1 // indirect
103106
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
104107
github.com/jjti/go-spancheck v0.6.4 // indirect
105108
github.com/julz/importas v0.2.0 // indirect
106109
github.com/karamaru-alpha/copyloopvar v1.2.1 // indirect
107110
github.com/kisielk/errcheck v1.9.0 // indirect
108111
github.com/kkHAIKE/contextcheck v1.1.6 // indirect
109112
github.com/kulti/thelper v0.6.3 // indirect
110-
github.com/kunwardeep/paralleltest v1.0.10 // indirect
113+
github.com/kunwardeep/paralleltest v1.0.14 // indirect
111114
github.com/lasiar/canonicalheader v1.1.2 // indirect
112-
github.com/ldez/exptostd v0.4.2 // indirect
115+
github.com/ldez/exptostd v0.4.3 // indirect
113116
github.com/ldez/gomoddirectives v0.6.1 // indirect
114117
github.com/ldez/grignotin v0.9.0 // indirect
115118
github.com/ldez/tagliatelle v0.7.1 // indirect
116-
github.com/ldez/usetesting v0.4.2 // indirect
119+
github.com/ldez/usetesting v0.4.3 // indirect
117120
github.com/leonklingele/grouper v1.1.2 // indirect
118121
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
119122
github.com/macabu/inamedparam v0.2.0 // indirect
120123
github.com/magiconair/properties v1.8.6 // indirect
124+
github.com/manuelarte/funcorder v0.2.1 // indirect
121125
github.com/maratori/testableexamples v1.0.0 // indirect
122126
github.com/maratori/testpackage v1.1.1 // indirect
123127
github.com/matoous/godox v1.1.0 // indirect
124128
github.com/mattn/go-colorable v0.1.14 // indirect
125129
github.com/mattn/go-isatty v0.0.20 // indirect
126130
github.com/mattn/go-runewidth v0.0.16 // indirect
127131
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
128-
github.com/mgechev/revive v1.7.0 // indirect
132+
github.com/mgechev/revive v1.9.0 // indirect
129133
github.com/mitchellh/go-homedir v1.1.0 // indirect
130134
github.com/mitchellh/mapstructure v1.5.0 // indirect
131135
github.com/moricho/tparallel v0.3.2 // indirect
@@ -136,9 +140,9 @@ require (
136140
github.com/nunnatsa/ginkgolinter v0.19.1 // indirect
137141
github.com/olekukonko/tablewriter v0.0.5 // indirect
138142
github.com/pelletier/go-toml v1.9.5 // indirect
139-
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
143+
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
140144
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
141-
github.com/polyfloyd/go-errorlint v1.7.1 // indirect
145+
github.com/polyfloyd/go-errorlint v1.8.0 // indirect
142146
github.com/prometheus/client_golang v1.12.1 // indirect
143147
github.com/prometheus/client_model v0.2.0 // indirect
144148
github.com/prometheus/common v0.32.1 // indirect
@@ -157,12 +161,12 @@ require (
157161
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
158162
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
159163
github.com/sashamelentyev/usestdlibvars v1.28.0 // indirect
160-
github.com/securego/gosec/v2 v2.22.2 // indirect
164+
github.com/securego/gosec/v2 v2.22.3 // indirect
161165
github.com/sirupsen/logrus v1.9.3 // indirect
162166
github.com/sivchari/containedctx v1.0.3 // indirect
163167
github.com/sonatard/noctx v0.1.0 // indirect
164168
github.com/sourcegraph/go-diff v0.7.0 // indirect
165-
github.com/spf13/afero v1.12.0 // indirect
169+
github.com/spf13/afero v1.14.0 // indirect
166170
github.com/spf13/cast v1.5.0 // indirect
167171
github.com/spf13/cobra v1.9.1 // indirect
168172
github.com/spf13/jwalterweatherman v1.1.0 // indirect
@@ -176,8 +180,8 @@ require (
176180
github.com/tdakkota/asciicheck v0.4.1 // indirect
177181
github.com/tetafro/godot v1.5.0 // indirect
178182
github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect
179-
github.com/timonwong/loggercheck v0.10.1 // indirect
180-
github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect
183+
github.com/timonwong/loggercheck v0.11.0 // indirect
184+
github.com/tomarrell/wrapcheck/v2 v2.11.0 // indirect
181185
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
182186
github.com/ultraware/funlen v0.2.0 // indirect
183187
github.com/ultraware/whitespace v0.2.0 // indirect
@@ -190,7 +194,8 @@ require (
190194
github.com/ykadowak/zerologlint v0.1.5 // indirect
191195
gitlab.com/bosi/decorder v0.4.2 // indirect
192196
go-simpler.org/musttag v0.13.0 // indirect
193-
go-simpler.org/sloglint v0.9.0 // indirect
197+
go-simpler.org/sloglint v0.11.0 // indirect
198+
go.augendre.info/fatcontext v0.8.0 // indirect
194199
go.uber.org/atomic v1.7.0 // indirect
195200
go.uber.org/automaxprocs v1.6.0 // indirect
196201
go.uber.org/multierr v1.6.0 // indirect
@@ -201,14 +206,11 @@ require (
201206
golang.org/x/sync v0.13.0 // indirect
202207
golang.org/x/sys v0.32.0 // indirect
203208
golang.org/x/text v0.24.0 // indirect
204-
golang.org/x/tools/gopls v0.18.1 // indirect
205-
google.golang.org/protobuf v1.36.5 // indirect
209+
google.golang.org/protobuf v1.36.6 // indirect
206210
gopkg.in/ini.v1 v1.67.0 // indirect
207211
gopkg.in/yaml.v2 v2.4.0 // indirect
208212
gopkg.in/yaml.v3 v3.0.1 // indirect
209213
honnef.co/go/tools v0.6.1 // indirect
210-
mvdan.cc/gofumpt v0.7.0 // indirect
214+
mvdan.cc/gofumpt v0.8.0 // indirect
211215
mvdan.cc/unparam v0.0.0-20250301125049-0df0534333a4 // indirect
212216
)
213-
214-
tool golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize

0 commit comments

Comments
 (0)