-
Notifications
You must be signed in to change notification settings - Fork 818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use raw strings for regex patterns #3029
Conversation
8d5a0bc
to
bb69164
Compare
bb69164
to
978fb40
Compare
978fb40
to
f81aa4a
Compare
@@ -27,6 +27,7 @@ lint.select = [ | |||
"UP018", # -- Unnecessary {literal_type} call like `str("abc")`. (rewrite as a literal) -- | |||
"UP032", # -- Use f-string instead of `.format()` call -- | |||
"UP034", # -- Avoid extraneous parentheses -- | |||
"W", # -- Warnings, including invalid escape-sequence -- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also make this change in .pre-commit-config.yaml
and the Makefile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We moved the redundant specification of ruff
configuration out of those two a while back. So this pyproject.toml
is the authoritative source of ruff
config now, a dividend of DRY :)
94535e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once comment is addressed. Approving in advance
Avoid `SyntaxWarning` and/or `SyntaxError` messages when importing `unstructured.nlp.patterns` by using raw strings (`"r"` prefix) for regex patterns which may contain `\x` character sequences not recognized by the Python parser for normal strings.
f81aa4a
to
1894467
Compare
Summary
Avoid
SyntaxWarning
and/orSyntaxError
messages when importingunstructured.nlp.patterns
by using raw strings ("r"
prefix) for regex patterns which may contain\x
character sequences not recognized by the Python parser for normal strings.Fixes: #2495