fix: do not allow squash!
commits when merging (#32023)
While `fixup! ` is fine, `squash! ` means that the commit message needs tweaking, which cannot be done automatically during merging (i.e. it should be done by the PR author). Previously, `validate-commit-message` would always allow `squash! `-prefixed commits, which would cause problems during merging. This commit changes `validate-commit-message` to make it configurable whether such commits are allowed and configures the `gulp validate-commit-message` task, which is run as part of the `lint` job on CI, to not allow them. NOTE: This new check is disabled in the pre-commit git hook that is used to validate commit messages, because these commits might still be useful during development. PR Close #32023
This commit is contained in:

committed by
Kara Erickson

parent
2b289250d8
commit
c0d5684078
@ -45,7 +45,9 @@ module.exports = (gulp) => () => {
|
||||
console.log(`There are zero new commits between ${baseBranch} and HEAD`);
|
||||
}
|
||||
|
||||
const someCommitsInvalid = !commitsByLine.every(validateCommitMessage);
|
||||
const disallowSquashCommits = true;
|
||||
const someCommitsInvalid =
|
||||
!commitsByLine.every(m => validateCommitMessage(m, disallowSquashCommits));
|
||||
|
||||
if (someCommitsInvalid) {
|
||||
throw new Error(
|
||||
|
Reference in New Issue
Block a user