Update pylint deprecated plugin to use ansible-invalid* symbols (#77086)

pull/77127/head
Matt Martz 3 years ago committed by GitHub
parent 143904f49b
commit bdf37336c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
bugfixes:
- ansible-test - Pylint Deprecated Plugin - Use correct message symbols when date or version is not a float or str
(https://github.com/ansible/ansible/issues/77085)

@ -158,7 +158,7 @@ class AnsibleDeprecatedChecker(BaseChecker):
def _check_date(self, node, date):
if not isinstance(date, str):
self.add_message('invalid-date', node=node, args=(date,))
self.add_message('ansible-invalid-deprecated-date', node=node, args=(date,))
return
try:
@ -172,7 +172,11 @@ class AnsibleDeprecatedChecker(BaseChecker):
def _check_version(self, node, version, collection_name):
if not isinstance(version, (str, float)):
self.add_message('invalid-version', node=node, args=(version,))
if collection_name == 'ansible.builtin':
symbol = 'ansible-invalid-deprecated-version'
else:
symbol = 'collection-invalid-deprecated-version'
self.add_message(symbol, node=node, args=(version,))
return
version_no = str(version)

Loading…
Cancel
Save