fix: only check filter strings for separation instead of the entire line

This commit is contained in:
Robert Kaussow 2022-12-09 22:48:53 +01:00
parent e9f1c31e18
commit 4e22080912
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
1 changed files with 2 additions and 2 deletions

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: