Skip to content

Conversation

@aorumbayev
Copy link

@aorumbayev aorumbayev commented Nov 27, 2025

Addresses an edge case where the convert_case crate incorrectly transforms version strings like "v_1" into "V_1".
This change introduces a regular expression to correct these patterns, ensuring that version strings are properly cased as "v1".

Noticed this as part of regenerating tests for algod in py utils, many tests with v2 prefix were generated with filenames where v_2 is split

Copilot AI review requested due to automatic review settings November 27, 2025 13:40
Copilot finished reviewing on behalf of aorumbayev November 27, 2025 13:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an edge case in version string casing where the convert_case crate incorrectly transforms patterns like "v1" into "v_1" when converting cases. The fix uses a regular expression to normalize these patterns back to the expected format (e.g., "v_1" → "v1", "v_2" → "v2").

Key changes:

  • Added regex pattern matching to detect and correct version string patterns in the convert_case_filter function
  • Introduced LazyLock for efficient, thread-safe initialization of the regex pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Addresses an edge case where the `convert_case` crate incorrectly transforms version strings like "v_1" into "V_1".

This change introduces a regular expression to correct these patterns, ensuring that version strings are properly cased as "v1".
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.

1 participant