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
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@
10
10
-[NoFloats](#nofloats) - Prevents usage of floating-point types
11
11
-[Nomaps](#nomaps) - Restricts usage of map types
12
12
-[Nophase](#nophase) - Prevents usage of 'Phase' fields
13
-
-[Notimestamp](#Notimestamp) - Prevents usage of `TimeStamp` fields
13
+
-[Notimestamp](#notimestamp) - Prevents usage of 'TimeStamp' fields
14
14
-[OptionalFields](#optionalfields) - Validates optional field conventions
15
15
-[OptionalOrRequired](#optionalorrequired) - Ensures fields are explicitly marked as optional or required
16
16
-[RequiredFields](#requiredfields) - Validates required field conventions
@@ -154,7 +154,16 @@ Maps are discouraged apart from `map[string]string` which is used for labels and
154
154
155
155
## Notimestamp
156
156
157
-
The `notimestamp` linter checks that the fields in the API types don't contain a 'Timestamp', or any field which contains 'Timestamp' as a substring, e.g CreateTimestamp.
157
+
The `notimestamp` linter checks that the fields in the API are not named with the word 'Timestamp'.
158
+
159
+
The name of a field that specifies the time at which something occurs should be called `somethingTime`.Its recommended not use stamp (e.g., creationTimestamp).
160
+
161
+
### Fixes
162
+
163
+
The `notimestamp` linter will automatically fix fields and json tags that are named with the word 'TimeStamp'.
164
+
165
+
It will automatically replace 'TimeStamp' with 'Time' and update both the field and tag name.
166
+
Example: 'FooTimeStamp'will be updated to 'FooTime'.
0 commit comments