ci/validate: Ignore correctly indented lines starting with [

This commit is contained in:
Timothée Ravier 2024-05-31 19:00:45 +02:00
parent 440fa5e438
commit 0667595535

View file

@ -30,7 +30,7 @@ for root, dirs, files, rootfd in os.fwalk('.'):
print("Validating:", name)
with open(os.open(name, dir_fd=rootfd, flags=os.O_RDONLY)) as f:
yaml.safe_load(f)
result = subprocess.run(['grep', '-RniEv', '^( )*[a-z#/-]|^$|^#', name], encoding='UTF-8',
result = subprocess.run(['grep', '-RniEv', '^( )*[a-z#/-]|^( )*\\[|^$|^#', name], encoding='UTF-8',
preexec_fn=lambda: os.fchdir(rootfd))
if result.returncode == 0:
raise Exception("Found likely invalid indentation in YAML file: {}".format(name))