Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: wrap loop var tag #2610

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ansiblelint/rules/loop_var_prefix.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ You can use `loop_var` to specify a prefix for loop variables and ensure they ar

This rule can produce the following messages:

- `[loop-var-prefix[missing]` - Replace unsafe implicit `item` loop variable by adding `loop_var: <loop_var_prefix>...`.
- `[loop-var-prefix[wrong]` - Loop variable should start with <loop_var_prefix>
- `[loop-var-prefix[missing]` - Replace any unsafe implicit `item` loop variable by adding `loop_var: <loop_var_prefix>...`.
- `[loop-var-prefix[wrong]` - Ensure loop variables start with `<loop_var_prefix>`.

This is an opt-in rule.
You must enable it in your Ansible-lint configuration as follows:
Expand All @@ -30,7 +30,7 @@ enable_list:
loop:
- foo
- bar # <- These items do not have a unique prefix.
- name: Sets
- name: Sets a prefix that is not unique.
ansible.builtin.debug:
var: zz_item
loop:
Expand Down