Skip to content
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

fix(ng-dev): add DEPRECATION to invalid commit message #250

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ng-dev/commit-message/validate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ describe('validate-commit-message.js', () => {
expectValidationResult(validateCommitMessage(incorrectKeyword3), INVALID, [
'The commit message body contains an invalid deprecation note.',
]);

const incorrectKeyword4 =
'feat(compiler): this is just a usual commit message title\n\n' +
'This is a normal commit message body which does not exceed the max length\n' +
'limit. For more details see the following super long URL:\n\n' +
'DEPRECATION:\n' +
' * A to be removed\n' +
' * B to be removed';
expectValidationResult(validateCommitMessage(incorrectKeyword4), INVALID, [
'The commit message body contains an invalid deprecation note.',
]);
});
});

Expand Down
3 changes: 2 additions & 1 deletion ng-dev/commit-message/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ const INCORRECT_BREAKING_CHANGE_BODY_RE =
*
* - `DEPRECATED <some-content>` | Here we assume the colon is missing by accident.
* - `DEPRECATIONS: <some-content>` | The wrong keyword is used here.
* - `DEPRECATION: <some-content>` | The wrong keyword is used here.
* - `DEPRECATE: <some-content>` | The wrong keyword is used here.
* - `DEPRECATES: <some-content>` | The wrong keyword is used here.
*/
const INCORRECT_DEPRECATION_BODY_RE = /^(DEPRECATED[^:]|DEPRECATIONS|DEPRECATE:|DEPRECATES)/m;
const INCORRECT_DEPRECATION_BODY_RE = /^(DEPRECATED[^:]|DEPRECATIONS?|DEPRECATE:|DEPRECATES)/m;

/** Validate a commit message against using the local repo's config. */
export function validateCommitMessage(
Expand Down