mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-12 04:01:30 -07:00
Add a new check to ensure that module arguments are valid python identifiers (#53278)
* Add a new check to ensure that module arguments are valid python identifiers * Move the check up higher, out of the if docs block * Skip validate-modules on py2 * Remove errant alias
This commit is contained in:
parent
04c6f94269
commit
a639dc6d88
5 changed files with 40 additions and 4 deletions
|
@ -36,6 +36,11 @@ from lib.test import (
|
|||
VALIDATE_SKIP_PATH = 'test/sanity/validate-modules/skip.txt'
|
||||
VALIDATE_IGNORE_PATH = 'test/sanity/validate-modules/ignore.txt'
|
||||
|
||||
UNSUPPORTED_PYTHON_VERSIONS = (
|
||||
'2.6',
|
||||
'2.7',
|
||||
)
|
||||
|
||||
|
||||
class ValidateModulesTest(SanitySingleVersion):
|
||||
"""Sanity test using validate-modules."""
|
||||
|
@ -45,6 +50,10 @@ class ValidateModulesTest(SanitySingleVersion):
|
|||
:type targets: SanityTargets
|
||||
:rtype: TestResult
|
||||
"""
|
||||
if args.python_version in UNSUPPORTED_PYTHON_VERSIONS:
|
||||
display.warning('Skipping validate-modules on unsupported Python version %s.' % args.python_version)
|
||||
return SanitySkipped(self.name)
|
||||
|
||||
skip_paths = read_lines_without_comments(VALIDATE_SKIP_PATH)
|
||||
skip_paths_set = set(skip_paths)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue