-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add name[casing] to identify wrongly capitalized task names
Fixes: #2169
- Loading branch information
Showing
4 changed files
with
56 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- hosts: all | ||
tasks: | ||
- name: this task has a name is not correctly capitalized | ||
ansible.builtin.command: echo "Hello World" | ||
changed_when: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## name | ||
|
||
This rule identifies several problems related to task naming. This is important | ||
because these names are the primary way to identify executed tasks on console, | ||
logs or web interface. Their role is also to document what a task is supposed | ||
to do. | ||
|
||
- `name[missing]` - All tasks are required to have a name | ||
- `name[casing]` - All task names should start with a capital letter | ||
|
||
### Problematic code | ||
|
||
```yaml | ||
--- | ||
- ansible.builtin.command: touch /tmp/.placeholder | ||
``` | ||
|
||
### Correct code | ||
|
||
```yaml | ||
--- | ||
- name: Create placeholder file | ||
ansible.builtin.command: touch /tmp/.placeholder | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters