Skip to content

Commit

Permalink
Mark load-failure violation as unskippable (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jun 8, 2022
1 parent dd09b67 commit c25b380
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 16 additions & 1 deletion src/ansiblelint/_internal/rules.py
Expand Up @@ -10,6 +10,20 @@
from ansiblelint.file_utils import Lintable

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


# Derived rules are likely to want to access class members, so:
Expand Down Expand Up @@ -130,5 +144,6 @@ class LoadingFailureRule(BaseRule):
id = "load-failure"
description = "Linter failed to process a YAML file, possible not an Ansible file."
severity = "VERY_HIGH"
tags = ["core"]
tags = ["core", "unskippable"]
version_added = "v4.3.0"
help = LOAD_FAILURE_MD
1 change: 0 additions & 1 deletion test/eco/colsystem.result
Expand Up @@ -8,7 +8,6 @@ You can skip specific rules or tags by adding them to your configuration file:
# .config/ansible-lint.yml
warn_list: # or 'skip_list' to silence them completely
- experimental # all rules tagged as experimental
- load-failure # Failed to load or parse file.
- no-handler # Tasks that run when changed should likely be handlers.
- unnamed-task # All tasks should be named.
- yaml # Violations reported by yamllint.
Expand Down

0 comments on commit c25b380

Please sign in to comment.