Skip to content

A new rule that makes sure the user have explained the reason of reverting #31

Closed
tehraninasab wants to merge 9 commits intonblockchain:masterfrom
tehraninasab:properRevertMessage-squashed
Closed

A new rule that makes sure the user have explained the reason of reverting #31
tehraninasab wants to merge 9 commits intonblockchain:masterfrom
tehraninasab:properRevertMessage-squashed

Conversation

@tehraninasab
Copy link
Contributor

No description provided.

@knocte
Copy link
Member

knocte commented Nov 15, 2022

CI is red.

test('proper-revert-message2', () => {
let commitMsgWithProperRevertMessage =
'Revert 9bb557e54830690b8a8e403d1b74780d86b07b4c\n\n' +
'We need to revert this commit, because/otherwise bla bla.'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make the commit message identical to the one in the first test, except for adding the reasoning later; we don't need the user to re-write the revert commit message, we want the user to expand on it

Copy link
Contributor Author

@tehraninasab tehraninasab Nov 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see the commit "set defaultIgnores to false" be green after a red one (so that it's clear that it's what makes the test pass), but I can't see that:

Screenshot 2022-11-15 at 12 58 33 PM

Oh, you are right. It's a squashed branch, and the previous branch was far behind the master and had conflicts with the master branch so I had to rebase it when I wanted to create a PR. Therefore it can't be seen now. What should I do?


if (lineBreakIndex >= 0){
// Extracting bodyStr from rawStr rather than using body directly is a
// workaround for https://github.com/conventional-changelog/commitlint/issues/3412
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the workaround here if the tests don't involve references?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, but shouldn't I add a test that involves references? I thought it was possible in revert messages too

@knocte
Copy link
Member

knocte commented Nov 15, 2022

I'd like to see the commit "set defaultIgnores to false" be green after a red one (so that it's clear that it's what makes the test pass), but I can't see that:

Screenshot 2022-11-15 at 12 58 33 PM

@tehraninasab tehraninasab force-pushed the properRevertMessage-squashed branch from c0c05a1 to 938bc4c Compare November 15, 2022 09:04
@tehraninasab
Copy link
Contributor Author

This PR is closed and replaced by another PR because of some version control problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants