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

build: add release as a valid commit message subject #19955

Closed
wants to merge 2 commits 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/validate-commit-message/commit-message.json
@@ -1,5 +1,5 @@
{
"maxLength": 100,
"maxLength": 120,
"types": [
"build",
"ci",
Expand All @@ -8,6 +8,7 @@
"fix",
"perf",
"refactor",
"release",
"style",
"test"
],
Expand Down
9 changes: 6 additions & 3 deletions tools/validate-commit-message/validate-commit-message.spec.js
Expand Up @@ -37,6 +37,8 @@ describe('validate-commit-message.js', function() {
expect(validateMessage('refactor(platform-webworker): something')).toBe(VALID);
expect(validateMessage('test(language-service): something')).toBe(VALID);
expect(validateMessage('test(packaging): something')).toBe(VALID);
expect(validateMessage('release: something')).toBe(VALID);
expect(validateMessage('release(packaging): something')).toBe(VALID);
expect(errors).toEqual([]);
});

Expand Down Expand Up @@ -65,16 +67,17 @@ describe('validate-commit-message.js', function() {
.forEach((expectedErrorMessage, index) => {
expect(expectedErrorMessage).toEqual(errors[index]);
});
expect(validateMessage('release(angular): something')).toBe(INVALID);
});


it('should validate 100 characters length', function() {
var msg =
'fix(compiler): something super mega extra giga tera long, maybe even longer and longer and longer... ';
'fix(compiler): something super mega extra giga tera long, maybe even longer and longer and longer and longer and longer and longer... ';

expect(validateMessage(msg)).toBe(INVALID);
expect(errors).toEqual([
'INVALID COMMIT MSG: "fix(compiler): something super mega extra giga tera long, maybe even longer and longer and longer... "\n => ERROR: The commit message is longer than 100 characters'
'INVALID COMMIT MSG: "fix(compiler): something super mega extra giga tera long, maybe even longer and longer and longer and longer and longer and longer... "\n => ERROR: The commit message is longer than 120 characters'
]);
});

Expand Down Expand Up @@ -106,7 +109,7 @@ describe('validate-commit-message.js', function() {
expect(errors).toEqual(
['INVALID COMMIT MSG: "weird($filter): something"\n' +
' => ERROR: weird is not an allowed type.\n' +
' => TYPES: build, ci, docs, feat, fix, perf, refactor, style, test']);
' => TYPES: build, ci, docs, feat, fix, perf, refactor, release, style, test']);
});


Expand Down