Skip to content

Commit c25b380

Browse files
authored
Mark load-failure violation as unskippable (#2201)
1 parent dd09b67 commit c25b380

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/ansiblelint/_internal/rules.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010
from ansiblelint.file_utils import Lintable
1111

1212
_logger = logging.getLogger(__name__)
13+
LOAD_FAILURE_MD = """\
14+
## load-failure
15+
16+
Linter failed to process a YAML file, probably because it is either:
17+
18+
* contains unsupported encoding (only UTF-8 is supported)
19+
* not an Ansible file
20+
* it contains some unsupported custom YAML objects (`!!` prefix)
21+
* it was not able to decrypt an inline `!vault` block.
22+
23+
This violation **is not** skippable, so it cannot be added to the `warn_list`
24+
or the `skip_list`. If a vault decryption issue cannot be avoided, the
25+
offending file can be added to `exclude_paths` configuration.
26+
"""
1327

1428

1529
# Derived rules are likely to want to access class members, so:
@@ -130,5 +144,6 @@ class LoadingFailureRule(BaseRule):
130144
id = "load-failure"
131145
description = "Linter failed to process a YAML file, possible not an Ansible file."
132146
severity = "VERY_HIGH"
133-
tags = ["core"]
147+
tags = ["core", "unskippable"]
134148
version_added = "v4.3.0"
149+
help = LOAD_FAILURE_MD

test/eco/colsystem.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ You can skip specific rules or tags by adding them to your configuration file:
88
# .config/ansible-lint.yml
99
warn_list: # or 'skip_list' to silence them completely
1010
- experimental # all rules tagged as experimental
11-
- load-failure # Failed to load or parse file.
1211
- no-handler # Tasks that run when changed should likely be handlers.
1312
- unnamed-task # All tasks should be named.
1413
- yaml # Violations reported by yamllint.

0 commit comments

Comments
 (0)