Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions docs/book/src/cronjob-tutorial/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,6 +56,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions docs/book/src/getting-started/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,6 +56,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions docs/book/src/multiversion-tutorial/testdata/project/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,6 +56,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
`
Original file line number Diff line number Diff line change
Expand Up @@ -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
`
14 changes: 14 additions & 0 deletions pkg/plugins/golang/v4/scaffolds/internal/templates/golangci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -88,6 +99,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
6 changes: 6 additions & 0 deletions testdata/project-v4-multigroup/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions testdata/project-v4-multigroup/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions testdata/project-v4-multigroup/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,6 +56,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
6 changes: 6 additions & 0 deletions testdata/project-v4-with-plugins/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions testdata/project-v4-with-plugins/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions testdata/project-v4-with-plugins/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,6 +56,9 @@ linters:
- dupl
- lll
path: internal/*
- path-except: "^api/"
linters:
- kubeapilinter
paths:
- third_party$
- builtin$
Expand Down
6 changes: 6 additions & 0 deletions testdata/project-v4/.custom-gcl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions testdata/project-v4/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading