Skip to content

Conversation

@AlexisMontagne
Copy link
Member

@AlexisMontagne AlexisMontagne commented Oct 28, 2025

What does this PR do?

Fixes #

What are the observable changes?

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation
  • Properly labeled

Additional Notes

@AlexisMontagne AlexisMontagne self-assigned this Oct 28, 2025
@AlexisMontagne AlexisMontagne requested a review from a team as a code owner October 28, 2025 18:43
@AlexisMontagne AlexisMontagne requested review from pauloestrella1994 and xgoffin and removed request for a team October 28, 2025 18:43
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

}

return strings.ToLower(s)
return strings.ToLower(strings.TrimPrefix(s, "_"))
Copy link

Choose a reason for hiding this comment

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

Bug: Regex Overlap Causes Double Underscore

The implementation introduces double underscores when an acronym is followed by a capitalized word. When the second regex ([A-Z]+) matches a sequence of uppercase letters that already has an underscore prefix from the first pass, it adds another underscore. For example, "WithAcronymLikeURL" becomes "with_acronym_like__url" instead of the expected "with_acronym_like_url" due to the double underscore before "url". The test case will fail because the actual output doesn't match the expected output.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

say what? 🫨

Copy link
Contributor

Choose a reason for hiding this comment

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

Bot is tired it seems :suspect:

}

return strings.ToLower(s)
return strings.ToLower(strings.TrimPrefix(s, "_"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Bot is tired it seems :suspect:

@AlexisMontagne AlexisMontagne merged commit 68dc322 into master Oct 29, 2025
5 checks passed
@AlexisMontagne AlexisMontagne deleted the am/strings-util-camel-case branch October 29, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants