Skip to content

Commit

Permalink
Allow var_naming_pattern in linter config schema (#2776)
Browse files Browse the repository at this point in the history
Fixes: #2751
  • Loading branch information
ssbarnea authored Dec 3, 2022
1 parent 14393ac commit 501adc7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ loop_var_prefix: "{role}_"
# Enforce variable names to follow pattern below, in addition to Ansible own
# requirements, like avoiding python identifiers. To disable add `var-naming`
# to skip_list.
# var_naming_pattern: "^[a-z_][a-z0-9_]*$"
var_naming_pattern: "^[a-z_][a-z0-9_]*$"

use_default_rules: true
# Load custom rules from this specific folder
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pyrsistent==0.19.2
pytest==7.2.0
pytest-mock==3.10.0
pytest-plus==0.2
pytest-xdist==3.0.2
pytest-xdist==3.1.0
pytz==2022.6
pyyaml==6.0
requests==2.28.1
Expand Down
5 changes: 5 additions & 0 deletions src/ansiblelint/schemas/ansible-lint-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@
"title": "Use Default Rules",
"type": "boolean"
},
"var_naming_pattern": {
"default": "^[a-z_][a-z0-9_]*$",
"title": "Regex used to verify variable names",
"type": "string"
},
"verbosity": {
"default": 0,
"title": "Verbosity",
Expand Down

0 comments on commit 501adc7

Please sign in to comment.