refactor: use lint-like rule identifier

This commit is contained in:
Robert Kaussow 2024-01-27 18:32:29 +01:00
parent 80ac8ec34d
commit 057939ca09
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
44 changed files with 102 additions and 102 deletions

View File

@ -18,8 +18,8 @@ HostVars
Rolesfile
Makefile
Jinja2
ANSIBLE([0-9]{4})
LINT([0-9]{4})
ANS([0-9]{4})
YML([0-9]{4})
SCM
bools
Check[A-Z].+

View File

@ -41,10 +41,10 @@ class Candidate:
excludes = self.config["rules"]["exclude_filter"]
if len(includes) == 0:
includes = [s.sid for s in self.rules]
includes = [s.rid for s in self.rules]
for rule in self.rules:
if rule.sid in includes and rule.sid not in excludes:
if rule.rid in includes and rule.rid not in excludes:
target_rules.append(rule)
return target_rules
@ -60,7 +60,7 @@ class Candidate:
result = rule.check(self, self.config)
if not result:
LOG.error(f"rule '{rule.sid}' returns an empty result object. Check failed!")
LOG.error(f"rule '{rule.rid}' returns an empty result object. Check failed!")
continue
labels = {
@ -70,23 +70,23 @@ class Candidate:
"passed": True,
}
if rule.sid and rule.sid.strip():
labels["sid"] = rule.sid
if rule.rid and rule.rid.strip():
labels["rid"] = rule.rid
for err in result.errors:
err_labels = copy.copy(labels)
err_labels["passed"] = False
sid = self._format_id(rule.sid)
rid = self._format_id(rule.rid)
path = self.path
description = rule.description
if isinstance(err, RuleBase.Error):
err_labels.update(err.to_dict())
msg = f"{sid}rule '{description}' not met:\n{path}:{err}"
msg = f"{rid}rule '{description}' not met:\n{path}:{err}"
if rule.sid not in self.config["rules"]["warning_filter"]:
if rule.rid not in self.config["rules"]["warning_filter"]:
LOG.error(msg, extra=flag_extra(err_labels))
errors = errors + 1
else:
@ -138,9 +138,9 @@ class Candidate:
return None
def _format_id(self, rule_id):
sid = rule_id.strip()
if sid:
rule_id = f"[{sid}] "
rid = rule_id.strip()
if rid:
rule_id = f"[{rid}] "
return rule_id

View File

@ -30,7 +30,7 @@ from ansiblelater.utils.yamlhelper import (
class RuleMeta(type):
def __call__(cls, *args):
mcls = type.__call__(cls, *args)
mcls.sid = cls.sid
mcls.rid = cls.rid
mcls.description = getattr(cls, "description", "__unknown__")
mcls.helptext = getattr(cls, "helptext", "")
mcls.types = getattr(cls, "types", [])
@ -46,7 +46,7 @@ class RuleBase(metaclass=RuleExtendedMeta):
@property
@abstractmethod
def sid(self):
def rid(self):
pass
@abstractmethod
@ -334,8 +334,8 @@ class RulesLoader:
)
def validate(self):
normalized_std = list(toolz.remove(lambda x: x.sid == "", self.rules))
unique_std = len(list(toolz.unique(normalized_std, key=lambda x: x.sid)))
normalized_std = list(toolz.remove(lambda x: x.rid == "", self.rules))
unique_std = len(list(toolz.unique(normalized_std, key=lambda x: x.rid)))
all_std = len(normalized_std)
if all_std != unique_std:
sysexit_with_message(

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckBecomeUser(RuleBase):
sid = "ANSIBLE0015"
rid = "ANS115"
description = "Become should be combined with become_user"
helptext = "the task has `become` enabled but `become_user` is missing"
types = ["playbook", "task", "handler"]

View File

@ -5,7 +5,7 @@ from ansiblelater.utils import count_spaces
class CheckBracesSpaces(RuleBase):
sid = "ANSIBLE0004"
rid = "ANS104"
description = "YAML should use consistent number of spaces around variables"
helptext = "no suitable numbers of spaces (min: {min} max: {max})"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -22,7 +22,7 @@ from ansiblelater.rule import RuleBase
class CheckChangedInWhen(RuleBase):
sid = "ANSIBLE0026"
rid = "ANS126"
description = "Use handlers instead of `when: changed`"
helptext = "tasks using `when: result.changed` setting are effectively acting as a handler"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckCommandHasChanges(RuleBase):
sid = "ANSIBLE0011"
rid = "ANS111"
description = "Commands should be idempotent"
helptext = (
"commands should only read while using `changed_when` or try to be "

View File

@ -24,7 +24,7 @@ from ansiblelater.rule import RuleBase
class CheckCommandInsteadOfArgument(RuleBase):
sid = "ANSIBLE0017"
rid = "ANS117"
description = "Commands should not be used in place of module arguments"
helptext = "{exec} used in place of file modules argument {arg}"
types = ["playbook", "task", "handler"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckCommandInsteadOfModule(RuleBase):
sid = "ANSIBLE0008"
rid = "ANS108"
description = "Commands should not be used in place of modules"
helptext = "{exec} command used in place of {module} module"
types = ["playbook", "task", "handler"]

View File

@ -5,7 +5,7 @@ from ansiblelater.rule import RuleBase
class CheckCompareToEmptyString(RuleBase):
sid = "ANSIBLE0012"
rid = "ANS112"
description = 'Don\'t compare to empty string ""'
helptext = "use `when: var` rather than `when: var !=` (or conversely `when: not var`)"
types = ["playbook", "task", "handler", "template"]

View File

@ -5,7 +5,7 @@ from ansiblelater.rule import RuleBase
class CheckCompareToLiteralBool(RuleBase):
sid = "ANSIBLE0013"
rid = "ANS113"
description = "Don't compare to True or False"
helptext = "use `when: var` rather than `when: var == True` (or conversely `when: not var`)"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckDeprecated(RuleBase):
sid = "ANSIBLE9999"
rid = "ANS999"
description = "Deprecated features should not be used"
helptext = "`{old}` is deprecated and should not be used anymore. Use `{new}` instead."
types = ["playbook", "task", "handler"]

View File

@ -25,7 +25,7 @@ from ansiblelater.utils import has_glob, has_jinja
class CheckDeprecatedBareVars(RuleBase):
sid = "ANSIBLE0027"
rid = "ANS127"
description = "Deprecated bare variables in loops must not be used"
helptext = (
"bare var '{barevar}' in '{loop_type}' must use full var syntax '{{{{ {barevar} }}}}' "

View File

@ -23,7 +23,7 @@ from ansiblelater.rule import RuleBase
class CheckFilePermissionMissing(RuleBase):
sid = "ANSIBLE0018"
rid = "ANS118"
description = "File permissions unset or incorrect"
helptext = (
"`mode` parameter should set permissions explicitly (e.g. `mode: 0644`) "

View File

@ -22,7 +22,7 @@ from ansiblelater.rule import RuleBase
class CheckFilePermissionOctal(RuleBase):
sid = "ANSIBLE0019"
rid = "ANS119"
description = "Octal file permissions must contain leading zero or be a string"
helptext = "numeric file permissions without leading zero can behave in unexpected ways"
types = ["playbook", "task", "handler"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckFilterSeparation(RuleBase):
sid = "ANSIBLE0016"
rid = "ANS116"
description = "Jinja2 filters should be separated with spaces"
helptext = "no suitable numbers of spaces (required: 1)"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars"]

View File

@ -22,7 +22,7 @@ from ansiblelater.rule import RuleBase
class CheckGitHasVersion(RuleBase):
sid = "ANSIBLE0020"
rid = "ANS120"
description = "Git checkouts should use explicit version"
helptext = "git checkouts should point to an explicit commit or tag, not `latest`"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckInstallUseLatest(RuleBase):
sid = "ANSIBLE0009"
rid = "ANS109"
description = "Package installs should use present, not latest"
helptext = "package installs should use `state=present` with or without a version"
types = ["playbook", "task", "handler"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckLiteralBoolFormat(RuleBase):
sid = "ANSIBLE0014"
rid = "ANS114"
description = "Literal bools should be consistent"
helptext = "literal bools should be written as `{bools}`"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckLocalAction(RuleBase):
sid = "ANSIBLE0024"
rid = "ANS124"
description = "Don't use local_action"
helptext = "`delegate_to: localhost` should be used instead of `local_action`"
types = ["playbook", "task", "handler"]

View File

@ -5,7 +5,7 @@ from ansiblelater.rule import RuleBase
class CheckMetaChangeFromDefault(RuleBase):
sid = "ANSIBLE0021"
rid = "ANS121"
description = "Roles meta/main.yml default values should be changed"
helptext = "meta/main.yml default values should be changed for: `{field}`"
types = ["meta"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckMetaMain(RuleBase):
sid = "ANSIBLE0002"
rid = "ANS102"
description = "Roles must contain suitable meta/main.yml"
helptext = "file should contain `{key}` key"
types = ["meta"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckNameFormat(RuleBase):
sid = "ANSIBLE0007"
rid = "ANS107"
description = "Name of tasks and handlers must be formatted"
helptext = "name `{name}` should start with uppercase"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckNamedTask(RuleBase):
sid = "ANSIBLE0006"
rid = "ANS106"
description = "Tasks and handlers must be named"
helptext = "module `{module}` used without or empty `name` attribute"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckNativeYaml(RuleBase):
sid = "LINT0008"
rid = "YML108"
description = "Use YAML format for tasks and handlers rather than key=value"
helptext = "task arguments appear to be in key value rather than YAML format"
types = ["playbook", "task", "handler"]

View File

@ -25,7 +25,7 @@ from ansiblelater.rule import RuleBase
class CheckNestedJinja(RuleBase):
sid = "ANSIBLE0023"
rid = "ANS123"
description = "Don't use nested Jinja2 pattern"
helptext = (
"there should not be any nested jinja pattern "

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckRelativeRolePaths(RuleBase):
sid = "ANSIBLE0025"
rid = "ANS125"
description = "Don't use a relative path in a role"
helptext = "`copy` and `template` modules don't need relative path for `src`"
types = ["playbook", "task", "handler"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckScmInSrc(RuleBase):
sid = "ANSIBLE0005"
rid = "ANS105"
description = "Use `scm:` key rather than `src: scm+url`"
helptext = "usage of `src: scm+url` not recommended"
types = ["rolesfile"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckShellInsteadCommand(RuleBase):
sid = "ANSIBLE0010"
rid = "ANS110"
description = "Shell should only be used when essential"
helptext = "shell should only be used when piping, redirecting or chaining commands"
types = ["playbook", "task", "handler"]

View File

@ -5,7 +5,7 @@ from ansiblelater.rule import RuleBase
class CheckTaskSeparation(RuleBase):
sid = "ANSIBLE0001"
rid = "ANS101"
description = "Single tasks should be separated by empty line"
helptext = "missing task separation (required: 1 empty line)"
types = ["playbook", "task", "handler"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckUniqueNamedTask(RuleBase):
sid = "ANSIBLE0003"
rid = "ANS103"
description = "Tasks and handlers must be uniquely named within a single file"
helptext = "name `{name}` appears multiple times"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckWhenFormat(RuleBase):
sid = "ANSIBLE0022"
rid = "ANS122"
description = "Don't use Jinja2 in when"
helptext = (
"`when` is a raw Jinja2 expression, redundant {{ }} " "should be removed from variable(s)"

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlColons(RuleBase):
sid = "LINT0005"
rid = "YML105"
description = "YAML should use consistent number of spaces around colons"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlDocumentEnd(RuleBase):
sid = "LINT0009"
rid = "YML109"
description = "YAML should contain document end marker"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlDocumentStart(RuleBase):
sid = "LINT0004"
rid = "YML104"
description = "YAML should contain document start marker"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlEmptyLines(RuleBase):
sid = "LINT0001"
rid = "YML101"
description = "YAML should not contain unnecessarily empty lines"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -4,7 +4,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlFile(RuleBase):
sid = "LINT0006"
rid = "YML106"
description = "Roles file should be in yaml format"
helptext = "file does not have a .yml extension"
types = ["playbook", "task", "handler"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlHasContent(RuleBase):
sid = "LINT0007"
rid = "YML107"
description = "Files should contain useful content"
helptext = "the file appears to have no useful content"
types = ["playbook", "task", "handler", "rolevars", "defaults", "meta"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlHyphens(RuleBase):
sid = "LINT0003"
rid = "YML103"
description = "YAML should use consistent number of spaces after hyphens"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -2,7 +2,7 @@ from ansiblelater.rule import RuleBase
class CheckYamlIndent(RuleBase):
sid = "LINT0002"
rid = "YML102"
description = "YAML should not contain unnecessarily empty lines"
types = ["playbook", "task", "handler", "rolevars", "hostvars", "groupvars", "meta"]

View File

@ -123,8 +123,8 @@ class Settings:
"include_filter": [],
"exclude_filter": [],
"warning_filter": [
"ANSIBLE9999",
"ANSIBLE9998",
"ANS999",
"ANS998",
],
"ignore_dotfiles": True,
"exclude_files": [],

View File

@ -9,7 +9,7 @@ A typical rule check will look like:
{{< highlight Python "linenos=table" >}}
class CheckBecomeUser(RuleBase):
sid = "ANSIBLE0015"
rid = "ANS115"
description = "Become should be combined with become_user"
helptext = "the task has `become` enabled but `become_user` is missing"
types = ["playbook", "task", "handler"]

View File

@ -16,19 +16,19 @@ ansible:
# directory will be auto-detected and don't need to be added to this list.
custom_modules: []
# Settings for variable formatting rule (ANSIBLE0004)
# Settings for variable formatting rule (ANS104)
double-braces:
max-spaces-inside: 1
min-spaces-inside: 1
# List of allowed literal bools (ANSIBLE0014)
# List of allowed literal bools (ANS114)
literal-bools:
- "True"
- "False"
- "yes"
- "no"
# List of modules that don't need to be named (ANSIBLE0006).
# List of modules that don't need to be named (ANS106).
# You must specify each individual module name, globs or wildcards do not work!
named-task:
exclude:
@ -41,7 +41,7 @@ ansible:
- "import_role"
- "import_tasks"
# List of modules that are allowed to use the key=value format instead of the native YAML format (LINT0008).
# List of modules that are allowed to use the key=value format instead of the native YAML format (YML108).
# You must specify each individual module name, globs or wildcards do not work!
native-yaml:
exclude: []
@ -77,8 +77,8 @@ rules:
# List of rule ID's that should be displayed as a warning instead of an error. By default,
# no rules are marked as warnings. This list allows to degrade errors to warnings for each rule.
warning_filter:
- "ANSIBLE9999"
- "ANSIBLE9998"
- "ANS999"
- "ANS998"
# All dotfiles (including hidden folders) are excluded by default.
# You can disable this setting and handle dotfiles by yourself with `exclude_files`.

View File

@ -4,42 +4,42 @@ title: Included rules
Reviews are useless without some rules to check against. `ansible-later` comes with a set of built-in checks, which are explained in the following table.
| Rule | ID | Description | Parameter |
| ----------------------------- | ----------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------- |
| CheckYamlEmptyLines | LINT0001 | YAML should not contain unnecessarily empty lines. | {max: 1, max-start: 0, max-end: 1} |
| CheckYamlIndent | LINT0002 | YAML should be correctly indented. | {spaces: 2, check-multi-line-strings: false, indent-sequences: true} |
| CheckYamlHyphens | LINT0003 | YAML should use consistent number of spaces after hyphens (-). | {max-spaces-after: 1} |
| CheckYamlDocumentStart | LINT0004 | YAML should contain document start marker. | {document-start: {present: true}} |
| CheckYamlColons | LINT0005 | YAML should use consistent number of spaces around colons. | {colons: {max-spaces-before: 0, max-spaces-after: 1}} |
| CheckYamlFile | LINT0006 | Roles file should be in YAML format. | |
| CheckYamlHasContent | LINT0007 | Files should contain useful content. | |
| CheckNativeYaml | LINT0008 | Use YAML format for tasks and handlers rather than key=value. | {native-yaml: {exclude: []}} |
| CheckYamlDocumentEnd | LINT0009 | YAML should contain document end marker. | {document-end: {present: true}} |
| CheckTaskSeparation | ANSIBLE0001 | Single tasks should be separated by an empty line. | |
| CheckMetaMain | ANSIBLE0002 | Meta file should contain a basic subset of parameters. | author, description, min_ansible_version, platforms, dependencies |
| CheckUniqueNamedTask | ANSIBLE0003 | Tasks and handlers must be uniquely named within a file. | |
| CheckBraces | ANSIBLE0004 | YAML should use consistent number of spaces around variables. | {double-braces: max-spaces-inside: 1, min-spaces-inside: 1} |
| CheckScmInSrc | ANSIBLE0005 | Use SCM key rather than `src: scm+url` in requirements file. | |
| CheckNamedTask | ANSIBLE0006 | Tasks and handlers must be named. | {named-task: {exclude: [meta, debug, block, include\_\*, import\_\*]}} |
| CheckNameFormat | ANSIBLE0007 | Name of tasks and handlers must be formatted. | formats: first letter capital |
| CheckCommandInsteadofModule | ANSIBLE0008 | Commands should not be used in place of modules. | |
| CheckInstallUseLatest | ANSIBLE0009 | Package managers should not install with state=latest. | |
| CheckShellInsteadCommand | ANSIBLE0010 | Use Shell only when piping, redirecting or chaining commands. | |
| CheckCommandHasChanges | ANSIBLE0011 | Commands should be idempotent and only used with some checks. | |
| CheckCompareToEmptyString | ANSIBLE0012 | Don't compare to "" - use `when: var` or `when: not var`. | |
| CheckCompareToLiteralBool | ANSIBLE0013 | Don't compare to True/False - use `when: var` or `when: not var`. | |
| CheckLiteralBoolFormat | ANSIBLE0014 | Literal bools should be consistent. | {literal-bools: [True, False, yes, no]} |
| CheckBecomeUser | ANSIBLE0015 | Become should be combined with become_user. | |
| CheckFilterSeparation | ANSIBLE0016 | Jinja2 filters should be separated with spaces. | |
| CheckCommandInsteadOfArgument | ANSIBLE0017 | Commands should not be used in place of module arguments. | |
| CheckFilePermissionMissing | ANSIBLE0018 | File permissions unset or incorrect. | |
| CheckFilePermissionOctal | ANSIBLE0019 | Octal file permissions must contain leading zero or be a string. | |
| CheckGitHasVersion | ANSIBLE0020 | Git checkouts should use explicit version. | |
| CheckMetaChangeFromDefault | ANSIBLE0021 | Roles meta/main.yml default values should be changed. | |
| CheckWhenFormat | ANSIBLE0022 | Don't use Jinja2 in `when`. | |
| CheckNestedJinja | ANSIBLE0023 | Don't use nested Jinja2 pattern. | |
| 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`. | |
| CheckChangedInWhen | ANSIBLE0027 | Deprecated bare variables in loops must not be used. | |
| CheckDeprecated | ANSIBLE9999 | Deprecated features of `ansible-later` should not be used. | |
| Rule | ID | Description | Parameter |
| ----------------------------- | ------ | ----------------------------------------------------------------- | ---------------------------------------------------------------------- |
| CheckYamlEmptyLines | YML101 | YAML should not contain unnecessarily empty lines. | {max: 1, max-start: 0, max-end: 1} |
| CheckYamlIndent | YML102 | YAML should be correctly indented. | {spaces: 2, check-multi-line-strings: false, indent-sequences: true} |
| CheckYamlHyphens | YML103 | YAML should use consistent number of spaces after hyphens (-). | {max-spaces-after: 1} |
| CheckYamlDocumentStart | YML104 | YAML should contain document start marker. | {document-start: {present: true}} |
| CheckYamlColons | YML105 | YAML should use consistent number of spaces around colons. | {colons: {max-spaces-before: 0, max-spaces-after: 1}} |
| CheckYamlFile | YML106 | Roles file should be in YAML format. | |
| CheckYamlHasContent | YML107 | Files should contain useful content. | |
| CheckNativeYaml | YML108 | Use YAML format for tasks and handlers rather than key=value. | {native-yaml: {exclude: []}} |
| CheckYamlDocumentEnd | YML109 | YAML should contain document end marker. | {document-end: {present: true}} |
| CheckTaskSeparation | ANS101 | Single tasks should be separated by an empty line. | |
| CheckMetaMain | ANS102 | Meta file should contain a basic subset of parameters. | author, description, min_ansible_version, platforms, dependencies |
| CheckUniqueNamedTask | ANS103 | Tasks and handlers must be uniquely named within a file. | |
| CheckBraces | ANS104 | YAML should use consistent number of spaces around variables. | {double-braces: max-spaces-inside: 1, min-spaces-inside: 1} |
| CheckScmInSrc | ANS105 | Use SCM key rather than `src: scm+url` in requirements file. | |
| CheckNamedTask | ANS106 | Tasks and handlers must be named. | {named-task: {exclude: [meta, debug, block, include\_\*, import\_\*]}} |
| CheckNameFormat | ANS107 | Name of tasks and handlers must be formatted. | formats: first letter capital |
| CheckCommandInsteadofModule | ANS108 | Commands should not be used in place of modules. | |
| CheckInstallUseLatest | ANS109 | Package managers should not install with state=latest. | |
| CheckShellInsteadCommand | ANS110 | Use Shell only when piping, redirecting or chaining commands. | |
| CheckCommandHasChanges | ANS111 | Commands should be idempotent and only used with some checks. | |
| CheckCompareToEmptyString | ANS112 | Don't compare to "" - use `when: var` or `when: not var`. | |
| CheckCompareToLiteralBool | ANS113 | Don't compare to True/False - use `when: var` or `when: not var`. | |
| CheckLiteralBoolFormat | ANS114 | Literal bools should be consistent. | {literal-bools: [True, False, yes, no]} |
| CheckBecomeUser | ANS115 | Become should be combined with become_user. | |
| CheckFilterSeparation | ANS116 | Jinja2 filters should be separated with spaces. | |
| CheckCommandInsteadOfArgument | ANS117 | Commands should not be used in place of module arguments. | |
| CheckFilePermissionMissing | ANS118 | File permissions unset or incorrect. | |
| CheckFilePermissionOctal | ANS119 | Octal file permissions must contain leading zero or be a string. | |
| CheckGitHasVersion | ANS120 | Git checkouts should use explicit version. | |
| CheckMetaChangeFromDefault | ANS121 | Roles meta/main.yml default values should be changed. | |
| CheckWhenFormat | ANS122 | Don't use Jinja2 in `when`. | |
| CheckNestedJinja | ANS123 | Don't use nested Jinja2 pattern. | |
| CheckLocalAction | ANS124 | Don't use local_action. | |
| CheckRelativeRolePaths | ANS125 | Don't use a relative path in a role. | |
| CheckChangedInWhen | ANS126 | Use handlers instead of `when: changed`. | |
| CheckChangedInWhen | ANS127 | Deprecated bare variables in loops must not be used. | |
| CheckDeprecated | ANS999 | Deprecated features of `ansible-later` should not be used. | |