Skip to content

Conversation

@NicolasMassart
Copy link
Contributor

@NicolasMassart NicolasMassart commented Apr 25, 2025

This PR changes the category extraction to use a RegExp to matches Conventional Commits that start with feat: or fix: (optionally with a scope like feat(scope):).

  • adds tests for getCategory to make sure all previous behaviours are preserved and new one works.
  • exports getCategory to make it testable.
  • updates getCategory to use regex to extract known category even when scope is present.

Regex breakdown

  • ^ – Start of the string
  • (feat|fix) – Must start with either feat or fix
  • (?:\([^)]*\))? – Optionally match a scope in parentheses like (bridge) or (ramps)
  • \s*:\s* – Requires a colon : (with optional spaces before/after)
  • /u – Unicode flag (as GitHub allows PR titles to contain unicode)

See https://consensys.slack.com/archives/C08N7NQRBPU/p1745578034343929

sethkfman
sethkfman previously approved these changes Apr 25, 2025
Copy link

@sethkfman sethkfman left a comment

Choose a reason for hiding this comment

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

LGTM

@NicolasMassart NicolasMassart self-assigned this Apr 25, 2025
@NicolasMassart NicolasMassart marked this pull request as ready for review April 25, 2025 15:09
@NicolasMassart NicolasMassart requested a review from a team as a code owner April 25, 2025 15:09
Copy link
Contributor

@MajorLift MajorLift left a comment

Choose a reason for hiding this comment

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

We should get codeowner approval from @MetaMask/wallet-framework-engineers

Copy link
Contributor

@cryptodev-2s cryptodev-2s left a comment

Choose a reason for hiding this comment

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

LGTM!

@MajorLift MajorLift dismissed their stale review April 25, 2025 16:19

codeowner approval received

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@NicolasMassart NicolasMassart merged commit c5a1264 into main Apr 29, 2025
25 checks passed
@NicolasMassart NicolasMassart deleted the fix/allow_category_scope branch April 29, 2025 13:26
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.

6 participants