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: pkg/analysis/duplicatemarkers/doc.go
+11-8Lines changed: 11 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -16,21 +16,24 @@ limitations under the License.
16
16
17
17
/*
18
18
duplicatemarkers is an analyzer that checks for duplicate markers in the API types.
19
+
It reports exact matches for marker definitions.
19
20
20
-
It reports only if the marker and value together are completely unique now. For example, the `duplicatemarkers` will not diagnose the field has kubebuilder:validation:MaxLength=10 and kubebuilder:validation:MaxLength=11
21
-
22
-
Example:
21
+
For example, something like:
23
22
24
23
type Foo struct {
25
24
// +kubebuilder:validation:MaxLength=10
26
25
// +kubebuilder:validation:MaxLength=11
27
-
Field string `json:"field"`
26
+
type Bar string
28
27
}
29
28
30
-
// +kubebuilder:validation:MaxLength=10
31
-
// +kubebuilder:validation:MaxLength=11
32
-
type Bar string
29
+
would not be reported while something like:
30
+
31
+
type Foo struct {
32
+
// +kubebuilder:validation:MaxLength=10
33
+
// +kubebuilder:validation:MaxLength=10
34
+
type Bar string
35
+
}
33
36
34
-
About the duplicated markers which has different value, it requires specific rule for each marker, these are processed by its corresponding linter.
0 commit comments