Skip to content

Commit f05a50b

Browse files
authored
✨ Improve samples linting & fix samples lint issues
This commit includes: - Fix linter issues - Refactor fetchCronJob in sample controller reconcile func - Fix simple-external-plugin-tutorial lint issues - Fix getting-started tutorial lint issues - Fix multiversion tutorial lint issues - Fix cronjob-tutorial lint issues - Refactor cronjob controller reconcile to reduce cyclomatic complexity
1 parent 1a95342 commit f05a50b

File tree

8 files changed

+333
-212
lines changed

8 files changed

+333
-212
lines changed

.github/workflows/lint-sample.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ jobs:
1616
folder: [
1717
"testdata/project-v4",
1818
"testdata/project-v4-with-plugins",
19-
"testdata/project-v4-multigroup"
19+
"testdata/project-v4-multigroup",
20+
"docs/book/src/cronjob-tutorial/testdata/project",
21+
"docs/book/src/getting-started/testdata/project",
22+
"docs/book/src/multiversion-tutorial/testdata/project",
23+
"docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1",
24+
"docs/book/utils"
2025
]
2126
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
2227
steps:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
run:
2+
timeout: 5m
3+
allow-parallel-runners: true
4+
5+
issues:
6+
# don't skip warning about doc comments
7+
# don't exclude the default set of lint
8+
exclude-use-default: false
9+
# restore some of the defaults
10+
# (fill in the rest as needed)
11+
exclude-rules:
12+
- path: "api/*"
13+
linters:
14+
- lll
15+
- path: "internal/*"
16+
linters:
17+
- dupl
18+
- lll
19+
linters:
20+
disable-all: true
21+
enable:
22+
- dupl
23+
- errcheck
24+
- copyloopvar
25+
- ginkgolinter
26+
- goconst
27+
- gocyclo
28+
- gofmt
29+
- goimports
30+
- gosimple
31+
- govet
32+
- ineffassign
33+
- lll
34+
- misspell
35+
- nakedret
36+
- prealloc
37+
- revive
38+
- staticcheck
39+
- typecheck
40+
- unconvert
41+
- unparam
42+
- unused
43+
44+
linters-settings:
45+
revive:
46+
rules:
47+
- name: comment-spacings

0 commit comments

Comments
 (0)