Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
chore: add breaking change pr check ci#9050
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@yeonjuan! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
netlifybot commentedMay 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
nx-cloudbot commentedMay 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
function checkTitle(title) { | ||
if (/!/.test(title)) { | ||
raiseError(`Do not use exclamation mark ('!') in your PR Title.`); | ||
} | ||
} |
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.
Hmmm, isn't this too restrictive? I can imagine the several cases when!
might be used not in the "breaking changes" position (before the semicolon)
Here are several real world PRs that have an exclamation mark in their titles:
- feat(eslint-plugin): [prefer-optional-chain] support suggesting
!foo || !foo.bar
as a valid match for the rule #5594 - docs: add missing ! (...) around comparison cases in no-unnecessary-boolean-literal-compare fixer #6968
- feat(eslint-plugin): [no-extra-non-null-assertion] flag optional chain after a non-null assertion #1460
I guess we should restrict only the use offeat(...)!: ...
andfeat!: ...
. What do you think?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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.
One small note on PR title RegExp, otherwise LGTM!
} | ||
function checkTitle(title) { | ||
if (/^[a-z]+(\([a-z]+\))?!: /.test(title)) { |
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.
if(/^[a-z]+(\([a-z]+\))?!:/.test(title)){ | |
if(/^[a-z]+(\([a-z-]+\))?!:/.test(title)){ |
Without the dash, this regexp won't catchfeat(eslint-plugin)!: ...
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.
Thanks! I fixed itcde7ec4
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.
try { | ||
checkTitle(pullRequest.title); | ||
checkDescription(pullRequest.body, pullRequest.labels); | ||
} catch (e) { | ||
core.setFailed(e.message); | ||
} |
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.
Nit: I'd personally rather something likeconst error = checkTitle(...) || checkDescription(...)
. But this is fine for an internal script. If it does end up getting changed much later, we can always refactor. 🙂
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.
🚀
212d01c
intotypescript-eslint:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
Add CI that checks breaking change pr title and body.
!
) in PR title.