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 1ef3ec0
Show file tree
Hide file tree
Showing 2 changed files with 5 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"
}
}
}
4 changes: 2 additions & 2 deletions src/ansiblelint/rules/meta_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CheckRequiresAnsibleVersion(AnsibleLintRule):
# Also add devel to this list
supported_ansible = ["2.14.", "2.15.", "2.16."]
_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 be set to a supported version: {', '.join(supported_ansible)}",
"meta-runtime[invalid-version]": "'requires_ansible' is not a valid requirement specification",
}

Expand All @@ -56,7 +56,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 1ef3ec0

Please sign in to comment.