Skip to content

Commit

Permalink
Change: Extend script_tag_whitespaces to also check script_xref() tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfi-gb committed Oct 12, 2023
1 parent dbb64c1 commit 8818f53
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion troubadix/plugins/script_tag_whitespaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from troubadix.helper.patterns import (
_get_special_script_tag_pattern,
_get_tag_pattern,
get_xref_pattern,
)
from troubadix.plugin import FileContentPlugin, LinterError, LinterResult

Expand Down Expand Up @@ -51,7 +52,11 @@ def check_content(
name=SpecialScriptTag.NAME.value
).finditer(file_content)

matches = chain(tag_matches, name_matches)
xref_matches = get_xref_pattern(name=r".+?", flags=re.S).finditer(
file_content
)

matches = chain(tag_matches, name_matches, xref_matches)

for match in matches:
if re.match(r"^\s+.*", match.group("value")) or re.match(
Expand Down

0 comments on commit 8818f53

Please sign in to comment.