-
Notifications
You must be signed in to change notification settings - Fork 10
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
A new rule that makes sure the user have explained the reason of reverting #32
A new rule that makes sure the user have explained the reason of reverting #32
Conversation
@realmarv CI is red |
commitlintplugins.test.ts
Outdated
|
||
|
||
test('proper-revert-message3', () => { | ||
let commitMsgWithProperRevertMessage = 'Revert "add abbreviations.ts"'; |
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.
ah damn I'm reading test3 not test2, sorry, let me read test2
Ignore all my comments above, let's rebase this PR first. |
b61c426
to
fde940c
Compare
Done |
Should it be without a body?
…On Thu, 17 Nov 2022 at 13:21, Andres G. Aragoneses ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In commitlintplugins.test.ts
<#32 (comment)>
:
> + expect(properRevertMessage1.status).not.toBe(0);
+});
+
+
+test('proper-revert-message2', () => {
+ let commitMsgWithProperRevertMessage =
+ 'Revert "add abbreviations.ts"\n\n' +
+ 'This reverts commit 0272f587c7eece147e8d1756116b0b43e11c34ac\n' +
+ 'because/otherwise bla bla.'
+ let properRevertMessage2 = runCommitLintOnMsg(commitMsgWithProperRevertMessage);
+ expect(properRevertMessage2.status).toBe(0);
+});
+
+
+test('proper-revert-message3', () => {
+ let commitMsgWithProperRevertMessage = 'Revert "add abbreviations.ts"';
@realmarv <https://github.com/realmarv> let's add a new test that has the
commit message "Revert .NET6 migration", and it should have
assert(status).toBe(0)
—
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AL6SKIXMFBU4CGMNC4TKU7LWIX52HANCNFSM6AAAAAASA4QFU4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes, just a title that says "Revert .NET6 upd as it broke CI" |
Done |
1b6d4ca
to
fd72e45
Compare
commitlint.config.ts
Outdated
if (body !== null) { | ||
let bodyStr = convertAnyToString(body, "body").trim(); | ||
let lines = bodyStr.split('\n'); | ||
offence = lines[0].match(/^This reverts commit [^ ]{40}.$/) !== null && lines.length == 1; |
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.
@realmarv are you sure you don't need to escape the '.' here? AFAIU, dots in regexes act as any character, but here I think you're trying to match it with a real dot
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
You didn't push your branch with push1by1. Also, this PR needs a rebase. |
We need to make sure that the commit message is a revert commit message.
The user may explain the reason of reverting in the title.
The reason of reverting might be at the end of the first line.
The reason of reverting might be in the title.
21bf71f
to
7003a14
Compare
Done |
}, | ||
// Commitlint automatically ignores some kinds of commits like Revert commit messages. |
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 last things to do in this PR:
- (Nit) Add an EOL before this comment above, to visually separate it better from the rule configuration list.
- Remove the TODO comment related to this PR, at line 363.
This PR is closed and replaced with #68 because some commits needed to be squashed and rebased. |
This PR should also remove one TODO line from commitling.config.ts. |
Oops, this one is closed, sorry. |
No description provided.