unicode-org / jira-github-pr-check

Checks GitHub pull requests for valid and accepted Jira tickets. Used for ICU and CLDR
Other
11 stars 12 forks source link

slashes confuse the checker? #30

Open srl295 opened 3 years ago

srl295 commented 3 years ago

over on https://github.com/unicode-org/cldr/pull/1085 the following text failed both PR title and Commit title validation:

with "PR must begin with a Jira ticket ID" etc.

Changing to CLDR-14395 API for … fixed it. Something with slashes?

sffc commented 3 years ago

The following regex is used:

https://github.com/unicode-org/jira-github-pr-check/blob/f1863dbef0069c8d1b4510f51c4e34f20c2564c3/app.js#L16

So it's looking for a \w. This is to ensure that there's something besides whitespace following the Jira ticket number.

Suggestions for a better regex? Unicode letter property? (That won't fix the slash problem.) Maybe just \S?

markusicu commented 3 years ago

How about

const JIRA_COMMIT_PATTERN = /^([A-Z]+-\d+)\u0020\w/;

-->

const JIRA_COMMIT_PATTERN = /^((CLDR|ICU)-\d+) [\p{L}\p{N}\p{P}\p{S}]/u;

If \p{L} does not work, try \p{gc=L}.

macchiati commented 3 years ago

LGTM Mark

On Fri, Mar 5, 2021 at 3:46 PM Markus Scherer notifications@github.com wrote:

How about

const JIRA_COMMIT_PATTERN = /^([A-Z]+-\d+)\u0020\w/;

-->

const JIRA_COMMIT_PATTERN = /^((CLDR|ICU)-\d+) [\p{L}\p{N}\p{P}\p{S}]/u;

If \p{L} does not work, try \p{gc=L}.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/unicode-org/jira-github-pr-check/issues/30#issuecomment-791794661, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJLEMDWSZTMWQOOSHFKEQTTCFULXANCNFSM4YTYBY5Q .