-
Notifications
You must be signed in to change notification settings - Fork 122
[Python] Reformat variable regex #2484
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
Conversation
libs/dyn/dynvar/ref.go
Outdated
| var ( | ||
| // Regex should be in sync with _variable_regex in Python code. | ||
| // | ||
| // LINT.IfChange |
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.
I like this. For the Python version, could you add a more explicit comment for maintainers that they should keep the two in sync?
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.
Makes sense, fixed
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.
What acts on these annotations?
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 don't have implementation in GitHub actions. Some open source projects, for instance, Chromium, implement it. So this comment only captures intent. I wasn't able to find open source implementation
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 update it to some loud instruction instead?
The formatting makes me think it is taken care of automatically.
pietern
left a comment
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.
Thanks!
The effective regex is slightly changed, it now allows a sequence of multiple dashes or underscores, where it didn't before.
Changes
Reformat variable regex in Python code to follow Golang. The effective regex is not changed.
Why
We need to keep both regexes in sync.
Tests
Using existing tests and manually inspecting resulting regex.