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
Copy file name to clipboardExpand all lines: docs/linters.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,7 @@ The `jsontags` linter checks the tag name against the regex `"^[a-z][a-z0-9]*(?:
113
113
114
114
```yaml
115
115
lintersConfig:
116
-
jsonTags:
116
+
jsontags:
117
117
jsonTagRegex: "^[a-z][a-z0-9]*(?:[A-Z][a-z0-9]*)*$" # Provide a custom regex, which the json tag must match.
118
118
```
119
119
@@ -178,7 +178,7 @@ In this case, the `omitempty` policy can be set to `Ignore`, and the linter will
178
178
179
179
```yaml
180
180
lintersConfig:
181
-
optionalFields:
181
+
optionalfields:
182
182
pointers:
183
183
preference: Always | WhenRequired # Whether to always require pointers, or only when required. Defaults to `Always`.
184
184
policy: SuggestFix | Warn # The policy for pointers in optional fields. Defaults to `SuggestFix`.
@@ -216,7 +216,7 @@ The `optionalorrequired` linter also checks for the presence of optional or requ
216
216
217
217
```yaml
218
218
lintersConfig:
219
-
optionalOrRequired:
219
+
optionalorrequired:
220
220
preferredOptionalMarker: optional | kubebuilder:validation:Optional # The preferred optional marker to use, fixes will suggest to use this marker. Defaults to `optional`.
221
221
preferredRequiredMarker: required | kubebuilder:validation:Required # The preferred required marker to use, fixes will suggest to use this marker. Defaults to `required`.
222
222
```
@@ -236,7 +236,7 @@ and not having an `omitempty` value in their `json` tag.
236
236
237
237
```yaml
238
238
lintersConfig:
239
-
requiredFields:
239
+
requiredfields:
240
240
pointerPolicy: Warn | SuggestFix # The policy for pointers in required fields. Defaults to `SuggestFix`.
241
241
```
242
242
@@ -326,7 +326,7 @@ Because this linter has no way of determining which marker definition was intend
326
326
It can configured to include a set of custom markers in the analysis by setting:
Copy file name to clipboardExpand all lines: docs/new-linter.md
+44-44Lines changed: 44 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -24,70 +24,70 @@ Once you are within the `inspect.Preorder`, you can then implement the business
24
24
The registry in the analysis package co-ordinates the initialization of all linters.
25
25
Where linters have configuration, or are enabled/disabled by higher level configuration, the registry takes on making sure the linters are initialized correctly.
26
26
27
-
To enable the registry, each linter package must create an `Initializer` function that returns an `analysis.AnalyzerInitializer` interface (from `pkg/analysis`).
27
+
To enable the registry, each linter package must create an `Initializer` function that returns an `initializer.AnalyzerInitializer` interface (from `pkg/analysis/initializer`).
28
28
29
29
It is expected that each linter package contain a file `initializer.go`, the content of this file should be as follows:
30
30
31
31
```go
32
-
// Initializer returns the AnalyzerInitializer for this
33
-
// Analyzer so that it can be added to the registry.
34
-
funcInitializer() initializer {
35
-
return initializer{}
36
-
}
37
-
38
-
// intializer implements the AnalyzerInitializer interface.
0 commit comments