fix: only check filter strings for separation instead of the entire line (#502)

This commit is contained in:
Robert Kaussow 2022-12-11 12:43:04 +01:00 committed by GitHub
parent 39712f9e6b
commit fa35feee18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ class CheckFilterSeparation(StandardBase):
matches = []
braces = re.compile("{{(.*?)}}")
filters = re.compile(r"(?<=\|)([\s]{2,}[^\s}]+|[^\s]+)|([^\s{]+[\s]{2,}|[^\s]+)(?=\|)")
filters = re.compile(r"(?<=\|)((\s{2,})*\S+)|(\S+(\s{2,})*)(?=\|)")
if not errors:
for i, line in yamllines:
@ -24,7 +24,7 @@ class CheckFilterSeparation(StandardBase):
if match:
for item in match:
# replace potential regex in filters
item = re.sub(r"\(.+\)", "(dummy)", line)
item = re.sub(r"\(.+\)", "(dummy)", item)
matches.append((i, item))
for i, line in matches: