mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add some features to the pylint sanity check
* Enable specific tests (this lets us disable a group and then enable a particular test inside of it) * Comment out tests in the enable and disable files
This commit is contained in:
parent
0765ceb66d
commit
21564cdb98
2 changed files with 6 additions and 1 deletions
|
@ -451,7 +451,10 @@ def command_sanity_pylint(args, targets):
|
|||
skip_paths = skip_fd.read().splitlines()
|
||||
|
||||
with open('test/sanity/pylint/disable.txt', 'r') as disable_fd:
|
||||
disable = set(disable_fd.read().splitlines())
|
||||
disable = set(c for c in disable_fd.read().splitlines() if not c.strip().startswith('#'))
|
||||
|
||||
with open('test/sanity/pylint/enable.txt', 'r') as enable_fd:
|
||||
enable = set(c for c in enable_fd.read().splitlines() if not c.strip().startswith('#'))
|
||||
|
||||
skip_paths_set = set(skip_paths)
|
||||
|
||||
|
@ -469,6 +472,7 @@ def command_sanity_pylint(args, targets):
|
|||
'--ignored-modules', '_MovedItems',
|
||||
'--output-format', 'json',
|
||||
'--disable', ','.join(sorted(disable)),
|
||||
'--enable', ','.join(sorted(enable)),
|
||||
] + paths
|
||||
|
||||
env = ansible_environment(args)
|
||||
|
|
1
test/sanity/pylint/enable.txt
Normal file
1
test/sanity/pylint/enable.txt
Normal file
|
@ -0,0 +1 @@
|
|||
#wildcard-import
|
Loading…
Reference in a new issue