-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: replace re module with regex #13786
base: main
Are you sure you want to change the base?
Conversation
How about doing that in the regex check only? There is no use for this elsewhere and I'm worried about performance regressions. |
Apparently, it's not 100% API compatible, so let's introduced it really in the single place where it is wanted:
|
9e75ee0
to
f32da3e
Compare
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.
Would you be able to add the test for the expression you wanted to use? The existing tests are in weblate/checks/tests/test_placeholders.py.
Can you also please add |
4178d79
to
8c70461
Compare
I've added a test now, but not entirely sure what I'm doing. It seems to work, and would fail if |
This replaces all imports of the
re
regex module withregex
. This should be backward compatible withre
, so just changing the import should be enough.Some tests fail for as yet unknown reasons, as mentioned
regex
should be backward compatible withre
, so some tweaks to the tests might be needed.In the UI, all works as expected. You can use the following test regex check to validate.
Fixes #13728