-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support skipLabels that contain forward slash #254
Conversation
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
Preview of Release Notes to be CreatedChnaged
Dependencies
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Just would like to update the comment around the regex to point out that /
now matches
|
||
it('should handle labels containing a forward slash', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏🏼
@@ -2,7 +2,7 @@ module.exports.extractLabels = function (labelsString) { | |||
// Parses a list of labels. Each label can be of any length and will either end with a comma or be the end of the string. | |||
// Matches words (\w), whitespace characters (\s), dashes (-), plus signs (+), questions marks (\?), semi-colons (;), brackets (\[\]) and parenthesis (\(\)) | |||
// Each match may are may not have a trailing comma (,?). If one exists, it is removed before appending it to the list | |||
const regex = new RegExp(/([\w\s-+\?;\[\]\(\)]+,?)/, 'g') | |||
const regex = new RegExp(/([\w\s-\/+\?;\[\]\(\)]+,?)/, 'g') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼 Thank you.
Only thing is can we update the comment on line 3 to point out /
now matches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
Will merge and put this in the next release. Thinking a 3.5.0 since I don't see it as a patch but an improvement to support more label names |
The
skipLabels
currently splits labels that contain/
into multiple labels soskip/changelog
becomesskip, changelog
. This change fixes that so that a singleskip/changelog
(for example) label can be used.