mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-21 20:30:42 +00:00
fix: report deprecated ansible-later features as warning by default (#233)
This commit is contained in:
parent
6bbd302480
commit
123f8fbcb5
@ -165,16 +165,18 @@ class Candidate(object):
|
||||
extra=flag_extra(err_labels)
|
||||
)
|
||||
else:
|
||||
LOG.error(
|
||||
"{sid}Standard '{description}' not met:\n{path}:{error}".format(
|
||||
msg = "{sid}Standard '{description}' not met:\n{path}:{error}".format(
|
||||
sid=self._format_id(standard.sid),
|
||||
description=standard.description,
|
||||
path=self.path,
|
||||
error=err
|
||||
),
|
||||
extra=flag_extra(err_labels)
|
||||
)
|
||||
|
||||
if standard.sid not in self.config["rules"]["warning_filter"]:
|
||||
LOG.error(msg, extra=flag_extra(err_labels))
|
||||
errors = errors + 1
|
||||
else:
|
||||
LOG.warning(msg, extra=flag_extra(err_labels))
|
||||
|
||||
return errors
|
||||
|
||||
|
@ -120,6 +120,7 @@ class Settings(object):
|
||||
"standards": [],
|
||||
"filter": [],
|
||||
"exclude_filter": [],
|
||||
"warning_filter": ["ANSIBLE9999"],
|
||||
"ignore_dotfiles": True,
|
||||
"exclude_files": [],
|
||||
"version": ""
|
||||
|
@ -56,6 +56,12 @@ rules:
|
||||
# Exclude given rule ID's from checks
|
||||
exclude_filter: []
|
||||
|
||||
# List of rule ID's that should be displayed as a warning instead of an error. By default,
|
||||
# only rules whose version is higher than the current default version are marked as warnings.
|
||||
# This list allows to degrade errors to warnings for each rule.
|
||||
warning_filter:
|
||||
- "ANSIBLE9999"
|
||||
|
||||
# All dotfiles (including hidden folders) are excluded by default.
|
||||
# You can disable this setting and handle dotfiles by yourself with `exclude_files`.
|
||||
ignore_dotfiles: True
|
||||
|
@ -41,3 +41,4 @@ Reviews are nothing without some rules or standards against which to review. ans
|
||||
| CheckLocalAction | ANSIBLE0024 | Don't use local_action. | |
|
||||
| CheckRelativeRolePaths | ANSIBLE0025 | Don't use a relative path in a role. | |
|
||||
| CheckChangedInWhen | ANSIBLE0026 | Use handlers instead of `when: changed`. | |
|
||||
| CheckDeprecated | ANSIBLE9999 | Deprecated features of `ansible-later` should not be used. | |
|
||||
|
Loading…
Reference in New Issue
Block a user