Merge "Skip yaml validation for releasenotes and zuul.d"

This commit is contained in:
Zuul 2021-10-01 12:17:16 +00:00 committed by Gerrit Code Review
commit d7347599ee
2 changed files with 16 additions and 3 deletions

View File

@ -1318,6 +1318,10 @@ def parse_args():
action='count',
default=0,
help='output warnings and errors (-q) or only errors (-qq)')
p.add_argument('--skip-dir',
action='append',
dest='skip_dirs',
help='The directories to be skipped during file search')
p.add_argument('path_args',
nargs='*',
default=['.'])
@ -1326,6 +1330,7 @@ def parse_args():
args = parse_args()
skip_dirs = args.skip_dirs
path_args = args.path_args
quiet = args.quiet
exit_val = 0
@ -1337,8 +1342,16 @@ param_map = {}
for base_path in path_args:
if os.path.isdir(base_path):
for subdir, dirs, files in os.walk(base_path):
if '.tox' in dirs:
dirs.remove('.tox')
for skip_dir in skip_dirs:
if subdir.startswith(os.path.join('.', skip_dir, '')):
skip = True
break
else:
skip = False
if skip:
continue
for f in files:
file_path = os.path.join(subdir, f)
if 'tools/tests/nic_config_convert_samples' in file_path:

View File

@ -25,7 +25,7 @@ allowlist_externals =
bash
commands =
python ./tools/process-templates.py
python ./tools/yaml-validate.py .
python ./tools/yaml-validate.py . --skip-dir .tox --skip-dir releasenotes --skip-dir zuul.d
bash -c ./tools/roles-data-validation.sh
bash -c ./tools/check-up-to-date.sh
flake8