mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Blacklist __pycache__ directories
This commit is contained in:
parent
3c02af6494
commit
d6ecdfd00a
1 changed files with 5 additions and 0 deletions
|
@ -563,6 +563,8 @@ class ModuleValidator(Validator):
|
||||||
|
|
||||||
|
|
||||||
class PythonPackageValidator(Validator):
|
class PythonPackageValidator(Validator):
|
||||||
|
BLACKLIST_FILES = frozenset(('__pycache__',))
|
||||||
|
|
||||||
def __init__(self, path):
|
def __init__(self, path):
|
||||||
super(PythonPackageValidator, self).__init__()
|
super(PythonPackageValidator, self).__init__()
|
||||||
|
|
||||||
|
@ -580,6 +582,9 @@ class PythonPackageValidator(Validator):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
super(PythonPackageValidator, self).validate()
|
super(PythonPackageValidator, self).validate()
|
||||||
|
|
||||||
|
if self.basename in self.BLACKLIST_FILES:
|
||||||
|
return
|
||||||
|
|
||||||
init_file = os.path.join(self.path, '__init__.py')
|
init_file = os.path.join(self.path, '__init__.py')
|
||||||
if not os.path.exists(init_file):
|
if not os.path.exists(init_file):
|
||||||
self.errors.append('Ansible module subdirectories must contain an '
|
self.errors.append('Ansible module subdirectories must contain an '
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue