Skip to content

Commit b18308b

Browse files
committed
Ruff formatting
1 parent 69095c1 commit b18308b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guardrails/checks/text/keywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ def _compile_pattern(keywords: tuple[str, ...]) -> re.Pattern[str]:
8181
# Check first and last character of the original keyword for word character status
8282
starts_with_word_char = keyword and keyword[0].isalnum() or (keyword and keyword[0] == "_")
8383
ends_with_word_char = keyword and keyword[-1].isalnum() or (keyword and keyword[-1] == "_")
84-
84+
8585
prefix = r"(?<!\w)" if starts_with_word_char else ""
8686
suffix = r"(?!\w)" if ends_with_word_char else ""
8787
patterns.append(f"{prefix}{escaped}{suffix}")
88-
88+
8989
# (?<!\w) and (?!\w) emulate Unicode-aware word boundaries (letters, digits, underscore).
9090
pattern_text = "(?:" + "|".join(patterns) + ")"
9191

0 commit comments

Comments
 (0)