diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.custom-gcl.yml b/docs/book/src/cronjob-tutorial/testdata/project/.custom-gcl.yml index 6ef11b3bfc5..00082969eac 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/.custom-gcl.yml +++ b/docs/book/src/cronjob-tutorial/testdata/project/.custom-gcl.yml @@ -4,8 +4,14 @@ # # See: https://golangci-lint.run/plugins/module-plugins/ version: v2.8.0 +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.github/workflows/lint.yml b/docs/book/src/cronjob-tutorial/testdata/project/.github/workflows/lint.yml index 44abc1aa369..a79ce3ef382 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/.github/workflows/lint.yml +++ b/docs/book/src/cronjob-tutorial/testdata/project/.github/workflows/lint.yml @@ -19,5 +19,11 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: v2.8.0 + + - name: Run lint target run: make lint diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml index f966bb1ec0f..345648f2833 100644 --- a/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml +++ b/docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml @@ -23,11 +23,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -45,6 +56,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$ diff --git a/docs/book/src/getting-started/testdata/project/.custom-gcl.yml b/docs/book/src/getting-started/testdata/project/.custom-gcl.yml index 6ef11b3bfc5..00082969eac 100644 --- a/docs/book/src/getting-started/testdata/project/.custom-gcl.yml +++ b/docs/book/src/getting-started/testdata/project/.custom-gcl.yml @@ -4,8 +4,14 @@ # # See: https://golangci-lint.run/plugins/module-plugins/ version: v2.8.0 +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest diff --git a/docs/book/src/getting-started/testdata/project/.github/workflows/lint.yml b/docs/book/src/getting-started/testdata/project/.github/workflows/lint.yml index 44abc1aa369..a79ce3ef382 100644 --- a/docs/book/src/getting-started/testdata/project/.github/workflows/lint.yml +++ b/docs/book/src/getting-started/testdata/project/.github/workflows/lint.yml @@ -19,5 +19,11 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: v2.8.0 + + - name: Run lint target run: make lint diff --git a/docs/book/src/getting-started/testdata/project/.golangci.yml b/docs/book/src/getting-started/testdata/project/.golangci.yml index f966bb1ec0f..345648f2833 100644 --- a/docs/book/src/getting-started/testdata/project/.golangci.yml +++ b/docs/book/src/getting-started/testdata/project/.golangci.yml @@ -23,11 +23,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -45,6 +56,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$ diff --git a/docs/book/src/multiversion-tutorial/testdata/project/.custom-gcl.yml b/docs/book/src/multiversion-tutorial/testdata/project/.custom-gcl.yml index 6ef11b3bfc5..00082969eac 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/.custom-gcl.yml +++ b/docs/book/src/multiversion-tutorial/testdata/project/.custom-gcl.yml @@ -4,8 +4,14 @@ # # See: https://golangci-lint.run/plugins/module-plugins/ version: v2.8.0 +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest diff --git a/docs/book/src/multiversion-tutorial/testdata/project/.github/workflows/lint.yml b/docs/book/src/multiversion-tutorial/testdata/project/.github/workflows/lint.yml index 44abc1aa369..a79ce3ef382 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/.github/workflows/lint.yml +++ b/docs/book/src/multiversion-tutorial/testdata/project/.github/workflows/lint.yml @@ -19,5 +19,11 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: v2.8.0 + + - name: Run lint target run: make lint diff --git a/docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml b/docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml index f966bb1ec0f..345648f2833 100644 --- a/docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml +++ b/docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml @@ -23,11 +23,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -45,6 +56,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$ diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/customgcl.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/customgcl.go index 854cef4ce54..6ab5362c929 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/customgcl.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/customgcl.go @@ -50,9 +50,15 @@ const customGclTemplate = `# This file configures golangci-lint with module plug # # See: https://golangci-lint.run/plugins/module-plugins/ version: {{ .GolangciLintVersion }} +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest ` diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/github/lint.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/github/lint.go index 7627a2fc9f9..b0605ce646d 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/github/lint.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/github/lint.go @@ -67,6 +67,12 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: {{ .GolangciLintVersion }} + + - name: Run lint target run: make lint ` diff --git a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go index 7c9ffd25aac..a11215ca3a3 100644 --- a/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go +++ b/pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go @@ -66,11 +66,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -88,6 +99,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$ diff --git a/testdata/project-v4-multigroup/.custom-gcl.yml b/testdata/project-v4-multigroup/.custom-gcl.yml index 6ef11b3bfc5..00082969eac 100644 --- a/testdata/project-v4-multigroup/.custom-gcl.yml +++ b/testdata/project-v4-multigroup/.custom-gcl.yml @@ -4,8 +4,14 @@ # # See: https://golangci-lint.run/plugins/module-plugins/ version: v2.8.0 +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest diff --git a/testdata/project-v4-multigroup/.github/workflows/lint.yml b/testdata/project-v4-multigroup/.github/workflows/lint.yml index 44abc1aa369..a79ce3ef382 100644 --- a/testdata/project-v4-multigroup/.github/workflows/lint.yml +++ b/testdata/project-v4-multigroup/.github/workflows/lint.yml @@ -19,5 +19,11 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: v2.8.0 + + - name: Run lint target run: make lint diff --git a/testdata/project-v4-multigroup/.golangci.yml b/testdata/project-v4-multigroup/.golangci.yml index f966bb1ec0f..345648f2833 100644 --- a/testdata/project-v4-multigroup/.golangci.yml +++ b/testdata/project-v4-multigroup/.golangci.yml @@ -23,11 +23,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -45,6 +56,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$ diff --git a/testdata/project-v4-with-plugins/.custom-gcl.yml b/testdata/project-v4-with-plugins/.custom-gcl.yml index 6ef11b3bfc5..00082969eac 100644 --- a/testdata/project-v4-with-plugins/.custom-gcl.yml +++ b/testdata/project-v4-with-plugins/.custom-gcl.yml @@ -4,8 +4,14 @@ # # See: https://golangci-lint.run/plugins/module-plugins/ version: v2.8.0 +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest diff --git a/testdata/project-v4-with-plugins/.github/workflows/lint.yml b/testdata/project-v4-with-plugins/.github/workflows/lint.yml index 44abc1aa369..a79ce3ef382 100644 --- a/testdata/project-v4-with-plugins/.github/workflows/lint.yml +++ b/testdata/project-v4-with-plugins/.github/workflows/lint.yml @@ -19,5 +19,11 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: v2.8.0 + + - name: Run lint target run: make lint diff --git a/testdata/project-v4-with-plugins/.golangci.yml b/testdata/project-v4-with-plugins/.golangci.yml index f966bb1ec0f..345648f2833 100644 --- a/testdata/project-v4-with-plugins/.golangci.yml +++ b/testdata/project-v4-with-plugins/.golangci.yml @@ -23,11 +23,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -45,6 +56,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$ diff --git a/testdata/project-v4/.custom-gcl.yml b/testdata/project-v4/.custom-gcl.yml index 6ef11b3bfc5..00082969eac 100644 --- a/testdata/project-v4/.custom-gcl.yml +++ b/testdata/project-v4/.custom-gcl.yml @@ -4,8 +4,14 @@ # # See: https://golangci-lint.run/plugins/module-plugins/ version: v2.8.0 +name: golangci-lint-custom +destination: ./bin + plugins: # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) - module: "sigs.k8s.io/logtools" import: "sigs.k8s.io/logtools/logcheck/gclplugin" + version: latest + # kube-api-linter checks Kubernetes API conventions + - module: "sigs.k8s.io/kube-api-linter" version: latest diff --git a/testdata/project-v4/.github/workflows/lint.yml b/testdata/project-v4/.github/workflows/lint.yml index 44abc1aa369..a79ce3ef382 100644 --- a/testdata/project-v4/.github/workflows/lint.yml +++ b/testdata/project-v4/.github/workflows/lint.yml @@ -19,5 +19,11 @@ jobs: - name: Check linter configuration run: make lint-config + - name: Run linter + uses: golangci/golangci-lint-action@v8 + with: + version: v2.8.0 + + - name: Run lint target run: make lint diff --git a/testdata/project-v4/.golangci.yml b/testdata/project-v4/.golangci.yml index f966bb1ec0f..345648f2833 100644 --- a/testdata/project-v4/.golangci.yml +++ b/testdata/project-v4/.golangci.yml @@ -23,11 +23,22 @@ linters: - unparam - unused - logcheck + - kubeapilinter settings: custom: logcheck: type: "module" description: Checks Go logging calls for Kubernetes logging conventions. + kubeapilinter: + type: module + description: "Kube API Linter plugin" + original-url: "sigs.k8s.io/kube-api-linter" + settings: + linters: {} + lintersConfig: + optionalfields: + pointers: + preference: WhenRequired revive: rules: - name: comment-spacings @@ -45,6 +56,9 @@ linters: - dupl - lll path: internal/* + - path-except: "^api/" + linters: + - kubeapilinter paths: - third_party$ - builtin$