Skip to content

Commit

Permalink
Remove pointless trailing text from t-008 regex
Browse files Browse the repository at this point in the history
This regex is being used to return a set of nodes, not match substrings,
so the trailing context is irrelevant. The lint messages contain the
result of calling to_string on the nodes.
  • Loading branch information
apasel422 committed Jul 26, 2024
1 parent 90bd736 commit 06fff57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion se/se_epub_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -3365,7 +3365,7 @@ def lint(self, skip_lint_ignore: bool, allowed_messages: Optional[List[str]] = N
messages.append(LintMessage("f-001", "Illegal file or directory.", se.MESSAGE_TYPE_ERROR, Path(illegal_file)))

# Check for repeated punctuation
nodes = self.metadata_dom.xpath("/package/metadata/*[re:test(., '[,;]{2,}.{0,20}')]")
nodes = self.metadata_dom.xpath("/package/metadata/*[re:test(., '[,;]{2,}')]")
if nodes:
messages.append(LintMessage("t-008", "Repeated punctuation.", se.MESSAGE_TYPE_WARNING, self.metadata_file_path, [node.to_string() for node in nodes]))

Expand Down

0 comments on commit 06fff57

Please sign in to comment.