Skip to content

Commit

Permalink
Correct requires_ansible error message
Browse files Browse the repository at this point in the history
Related: #3950
  • Loading branch information
ssbarnea committed Dec 20, 2023
1 parent 3870c63 commit 813b927
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"evenBetterToml.formatter.alignComments": false,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": true
}
"source.organizeImports": "explicit",
"source.fixAll": "explicit"
}
}
}
5 changes: 3 additions & 2 deletions src/ansiblelint/rules/meta_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ class CheckRequiresAnsibleVersion(AnsibleLintRule):
# Refer to https://access.redhat.com/support/policy/updates/ansible-automation-platform
# Also add devel to this list
supported_ansible = ["2.14.", "2.15.", "2.16."]
supported_ansible_examples = [f">={x}0" for x in supported_ansible]
_ids = {
"meta-runtime[unsupported-version]": "'requires_ansible' key must be set to a supported version - 2.13.x, 2.14.x, 2.15.x",
"meta-runtime[unsupported-version]": f"'requires_ansible' key must refer to a currently supported version such: {', '.join(supported_ansible_examples)}",
"meta-runtime[invalid-version]": "'requires_ansible' is not a valid requirement specification",
}

Expand All @@ -56,7 +57,7 @@ def matchyaml(self, file: Lintable) -> list[MatchError]:
):
results.append(
self.create_matcherror(
message="requires_ansible key must be set to a supported version.",
message=self._ids["meta-runtime[unsupported-version]"],
tag="meta-runtime[unsupported-version]",
filename=file,
),
Expand Down

0 comments on commit 813b927

Please sign in to comment.