zeke / semantic-pull-requests

:robot: Let the robots take care of the semantic versioning
https://github.com/apps/semantic-pull-requests
Apache License 2.0
1.24k stars 122 forks source link

feat: added regex support for scopes #124

Closed puppybits closed 3 years ago

puppybits commented 3 years ago

RegEx support for scopes. This enables support for any project management system to enforce naming conventions in their PRs.

# You can define a list of valid scopes
scopes:
  - scope1
  - /^TASK-(\\d)+$/
  ...
puppybits commented 3 years ago

@zeke would you be ok with allowing regular expression support?

As an engineering manager it would help a ton to ensure all PRs are linked to our project management app.

puppybits commented 3 years ago

Hey thanks for the PR. I'd be happy to accept this change, but can you add a few more tests for different variants of the scope regexes? This might even be a good time to move that code into its own module with its own tests so we don't have to duplicate the whole setup of handle-pull-request-change tests. Does that make sense?

Sure. Thanks.

puppybits commented 3 years ago

@zeke I moved all scope checks to an is-scope-valid.js file and added a lot more tests. Let me know what you think.

zeke commented 3 years ago

Looks great. Thanks for adding all those tests and for preserving existing functionality. ⭐

This will be deployed automatically within a few minutes.

rittme commented 3 years ago

Maybe it's a coincidence, but the app looks broken since this PR was deployed. https://github.com/zeke/semantic-pull-requests/issues/125