Skip to content

Conversation

@kanterov
Copy link
Collaborator

@kanterov kanterov commented Mar 13, 2025

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.

var (
// Regex should be in sync with _variable_regex in Python code.
//
// LINT.IfChange
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, fixed

Copy link
Contributor

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?

Copy link
Collaborator Author

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

Copy link
Contributor

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.

@kanterov kanterov temporarily deployed to test-trigger-is March 13, 2025 12:23 — with GitHub Actions Inactive
@kanterov kanterov marked this pull request as ready for review March 13, 2025 12:51
@kanterov kanterov temporarily deployed to test-trigger-is March 13, 2025 13:42 — with GitHub Actions Inactive
Copy link
Contributor

@pietern pietern left a 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.

@pietern pietern enabled auto-merge March 13, 2025 13:48
@pietern pietern added this pull request to the merge queue Mar 13, 2025
Merged via the queue into main with commit 036061f Mar 13, 2025
14 checks passed
@pietern pietern deleted the python-update-regex branch March 13, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants