Skip to content

Commit aa1ed71

Browse files
authored
Allow toggling strict in the config file (#2603)
1 parent 388d015 commit aa1ed71

6 files changed

Lines changed: 12 additions & 1 deletion

File tree

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ exclude_paths:
1010
- test/fixtures/formatting-prettier/
1111
# parseable: true
1212
# quiet: true
13+
# strict: true
1314
# verbosity: 1
1415

1516
# Mock modules or roles in order to pass ansible-playbook --syntax-check

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
WSLENV: FORCE_COLOR:PYTEST_REQPASS:TOXENV:TOX_PARALLEL_NO_SPINNER
167167
# Number of expected test passes, safety measure for accidental skip of
168168
# tests. Update value if you add/remove tests.
169-
PYTEST_REQPASS: 707
169+
PYTEST_REQPASS: 708
170170

171171
steps:
172172
- name: Activate WSL1

src/ansiblelint/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ def merge_config(file_config: dict[Any, Any], cli_config: Namespace) -> Namespac
442442
"display_relative_path",
443443
"parseable",
444444
"quiet",
445+
"strict",
445446
"use_default_rules",
446447
"progressive",
447448
"offline",

src/ansiblelint/schemas/ansible-lint-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@
157157
"title": "Skip List",
158158
"type": "array"
159159
},
160+
"strict": {
161+
"default": false,
162+
"title": "Strict",
163+
"type": "boolean"
164+
},
160165
"tags": {
161166
"items": {
162167
"type": "string"

test/fixtures/strict.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
strict: true
3+
# vim: et:sw=2:syntax=yaml:ts=2:

test/test_commandline_invocations_same_as_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def fixture_base_arguments() -> list[str]:
2323
(["-q"], "test/fixtures/quiet.yml"),
2424
(["-r", "test/fixtures/rules/"], "test/fixtures/rulesdir.yml"),
2525
(["-R", "-r", "test/fixtures/rules/"], "test/fixtures/rulesdir-defaults.yml"),
26+
(["-s"], "test/fixtures/strict.yml"),
2627
(["-t", "skip_ansible_lint"], "test/fixtures/tags.yml"),
2728
(["-v"], "test/fixtures/verbosity.yml"),
2829
(["-x", "bad_tag"], "test/fixtures/skip-tags.yml"),

0 commit comments

Comments
 (0)