Skip to content

Commit c571f18

Browse files
committed
Fix docs on namingconventions replacement option
1 parent 077f0d3 commit c571f18

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/linters.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,12 @@ Naming conventions must have:
339339
- A unique human-readable name.
340340
- A human-readable message to be included in violation errors.
341341
- A regular expression that will match text within the field name that violates the convention.
342-
- A defined "operation". Allowed operations are `Inform`, `Drop`, `DropField`, and `Replace`.
342+
- A defined "operation". Allowed operations are `Inform`, `Drop`, `DropField`, and `Replacement`.
343343

344344
The `Inform` operation will simply inform when a field name violates the naming convention.
345345
The `Drop` operation will suggest a fix that drops violating text from the field name.
346346
The `DropField` operation will suggest a fix that removes the field in it's entirety.
347-
The `Replace` operation will suggest a fix that replaces the violating text in the field name with a defined replacement value.
347+
The `Replacement` operation will suggest a fix that replaces the violating text in the field name with a defined replacement value.
348348

349349
High-level configuration overview:
350350
```yaml
@@ -353,8 +353,8 @@ linterConfig:
353353
conventions:
354354
- name: {human readable string} # must be unique
355355
violationMatcher: {regular expression}
356-
operation: Inform | Drop | DropField | Replace
357-
replace: { replacement string } # required when operation is 'Replace', forbidden otherwise
356+
operation: Inform | Drop | DropField | Replacement
357+
replacement: { replacement string } # required when operation is 'Replacement', forbidden otherwise
358358
message: {human readable string}
359359
```
360360

@@ -400,8 +400,8 @@ linterConfig:
400400
conventions:
401401
- name: BritishEnglishColour
402402
violationMatcher: (?i)color
403-
operation: Replace
404-
replace: colour
403+
operation: Replacement
404+
replacement: colour
405405
message: prefer 'colour' over 'color' when referring to colours in field names
406406
```
407407

pkg/analysis/namingconventions/doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ Naming conventions must have:
2525
- A unique human-readable name.
2626
- A human-readable message to be included in violation errors.
2727
- A regular expression that will match text within the field name that violates the convention.
28-
- A defined "operation". Allowed operations are "Inform", "Drop", "DropField", and "Replace".
28+
- A defined "operation". Allowed operations are "Inform", "Drop", "DropField", and "Replacement".
2929
3030
The "Inform" operation will simply inform via a linter error when a field name violates the naming convention.
3131
The "Drop" operation will suggest a fix that drops violating text from the field name.
3232
The "DropField" operation will suggest a fix that removes the field in it's entirety.
33-
The "Replace" operation will suggest a fix that replaces the violating text in the field name with a defined replacement value.
33+
The "Replacement" operation will suggest a fix that replaces the violating text in the field name with a defined replacement value.
3434
3535
Some example configurations:
3636

0 commit comments

Comments
 (0)