You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will need to create a `.custom-gcl.yml` file to describe the custom linters you want to run. The following is an example of a `.custom-gcl.yml` file:
23
23
24
24
```yaml
25
-
version: v1.62.0
25
+
version: v1.64.8
26
26
name: golangci-kube-api-linter
27
27
destination: ./bin
28
28
plugins:
@@ -76,6 +76,37 @@ Where fixes are available within a rule, these can be applied automatically with
76
76
golangci-kube-api-linter run path/to/api/types --fix
77
77
```
78
78
79
+
### Golangci-lint Plugin
80
+
81
+
The Kube API Linter can also be used as a plugin for `golangci-lint`.
82
+
To do this, you will need to install the `golangci-lint` binary and then install the Kube API Linter plugin.
83
+
84
+
More information about golangci-lint plugins can be found in the [golangci-lint plugin documentation][golangci-lint-plugin-docs].
go build -buildmode=plugin -o bin/kube-api-linter.so sigs.k8s.io/kube-api-linter/pkg/plugin
90
+
```
91
+
92
+
This will create a `kube-api-linter.so` file in the `bin` directory.
93
+
94
+
The `golangci-lint` configuration is similar to the module configuration, however, you will need to specify the plugin path instead.
95
+
96
+
```yaml
97
+
linters-settings:
98
+
custom:
99
+
kubeapilinter:
100
+
path: "bin/kube-api-linter.so"
101
+
description: Kube API LInter lints Kube like APIs based on API conventions and best practices.
102
+
original-url: sigs.k8s.io/kube-api-linter
103
+
settings:
104
+
linters: {}
105
+
lintersConfig: {}
106
+
```
107
+
108
+
The rest of the configuration is the same as the module configuration, except the standard `golangci-lint` binary is invoked, rather than a custom binary.
109
+
79
110
#### VSCode integration
80
111
81
112
Since VSCode already integrates with `golangci-lint` via the [Go][vscode-go] extension, you can use the `golangci-kal` binary as a linter in VSCode.
0 commit comments