1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix test for missing __init__.py for modules.

This commit is contained in:
Matt Clay 2017-06-22 11:53:55 -07:00
parent e747650543
commit 75a3ac5ca5

View file

@ -1140,6 +1140,8 @@ def main():
reporter = Reporter() reporter = Reporter()
git_cache = GitCache(args.base_branch) git_cache = GitCache(args.base_branch)
check_dirs = set()
for module in args.modules: for module in args.modules:
if os.path.isfile(module): if os.path.isfile(module):
path = module path = module
@ -1150,6 +1152,7 @@ def main():
with ModuleValidator(path, analyze_arg_spec=args.arg_spec, with ModuleValidator(path, analyze_arg_spec=args.arg_spec,
base_branch=args.base_branch, git_cache=git_cache, reporter=reporter) as mv: base_branch=args.base_branch, git_cache=git_cache, reporter=reporter) as mv:
mv.validate() mv.validate()
check_dirs.add(os.path.dirname(path))
for root, dirs, files in os.walk(module): for root, dirs, files in os.walk(module):
basedir = root[len(module) + 1:].split('/', 1)[0] basedir = root[len(module) + 1:].split('/', 1)[0]
@ -1161,8 +1164,7 @@ def main():
path = os.path.join(root, dirname) path = os.path.join(root, dirname)
if args.exclude and args.exclude.search(path): if args.exclude and args.exclude.search(path):
continue continue
pv = PythonPackageValidator(path, reporter=reporter) check_dirs.add(path)
pv.validate()
for filename in files: for filename in files:
path = os.path.join(root, filename) path = os.path.join(root, filename)
@ -1174,6 +1176,10 @@ def main():
base_branch=args.base_branch, git_cache=git_cache, reporter=reporter) as mv: base_branch=args.base_branch, git_cache=git_cache, reporter=reporter) as mv:
mv.validate() mv.validate()
for path in sorted(check_dirs):
pv = PythonPackageValidator(path, reporter=reporter)
pv.validate()
if args.format == 'plain': if args.format == 'plain':
sys.exit(reporter.plain(warnings=args.warnings, output=args.output)) sys.exit(reporter.plain(warnings=args.warnings, output=args.output))
else: else: