Skip to content

Commit bf52459

Browse files
authored
Revise .ansible-lint configuration
Updated the .ansible-lint configuration with new paths and settings.
1 parent 1e31087 commit bf52459

File tree

1 file changed

+55
-12
lines changed

1 file changed

+55
-12
lines changed

.ansible-lint

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,64 @@
11
---
2-
# The exclude_paths does not appear to be working in pre-commit
3-
# this issue describes similar behavior but suggested fix doesn't work
4-
# https://github.com/ansible/ansible-lint/issues/371
5-
# exclude_paths:
6-
# - roles/master_role_example/
2+
# .ansible-lint
3+
4+
profile: production # min, basic, moderate,safety, shared, production
5+
6+
# Allows dumping of results in SARIF format
7+
# sarif_file: result.sarif
8+
9+
# exclude_paths included in this file are parsed relative to this file's location
10+
# and not relative to the CWD of execution. CLI arguments passed to the --exclude
11+
# option are parsed relative to the CWD of execution.
712
exclude_paths:
813
- .github/
9-
- roles/master_role_example/
1014
- changelogs/
15+
- tests/templated_role_example
16+
- .ansible/
17+
- tests/
18+
1119
parseable: true
12-
use_default_rules: true
13-
# https://github.com/ansible/ansible-lint/issues/808
14-
# with verbosity set to 1, its dumping 'unknown file type messages'
20+
# quiet: true
21+
# strict: true
1522
# verbosity: 1
23+
24+
# Enable checking of loop variable prefixes in roles
25+
loop_var_prefix: ^(__|{role}_)
26+
27+
# Enforce variable names to follow pattern below, in addition to Ansible own
28+
# requirements, like avoiding python identifiers. To disable add `var-naming`
29+
# to skip_list.
30+
var_naming_pattern: ^[a-z_][a-z0-9_]*$
31+
32+
use_default_rules: true
33+
# Load custom rules from this specific folder
34+
# rulesdir:
35+
# - ./rule/directory/
36+
37+
# Ansible-lint is able to recognize and load skip rules stored inside
38+
# `.ansible-lint-ignore` (or `.config/ansible-lint-ignore.txt`) files.
39+
# To skip a rule just enter filename and tag, like "playbook.yml package-latest"
40+
# on a new line.
41+
# Optionally you can add comments after the tag, prefixed by "#". We discourage
42+
# the use of skip_list below because that will hide violations from the output.
43+
# When putting ignores inside the ignore file, they are marked as ignored, but
44+
# still visible, making it easier to address later.
1645
skip_list:
46+
- jinja[spacing]
47+
- role-name[path]
48+
- sanity[cannot-ignore] # We're only ignoring sanity rules when we have to
1749
- var-naming[no-role-prefix]
18-
kinds:
19-
- vars: "**/examples/vars/*.yml"
20-
- vars: "**/examples/**/*.yml"
50+
51+
# Ansible-lint does not automatically load rules that have the 'opt-in' tag.
52+
# You must enable opt-in rules by listing each rule 'id' below.
53+
enable_list:
54+
- args
55+
- empty-string-compare # opt-in
56+
- no-log-password # opt-in
57+
- no-same-owner # opt-in
58+
- name[prefix] # opt-in
59+
- galaxy-version-incorrect # opt-in
60+
61+
# Ansible-lint does not fail on warnings from the rules or tags listed below
62+
warn_list:
63+
- experimental # experimental is included in the implicit list
2164
...

0 commit comments

Comments
 (0)