mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 22:45:52 +08:00
chore(validate-commit-msg.js): increase the max line limit for commit messages from 70 to 100
This commit is contained in:
@@ -16,7 +16,6 @@ var LINK_ISSUE = '[#%s](https://github.com/angular/angular.js/issues/%s)';
|
||||
var LINK_COMMIT = '[%s](https://github.com/angular/angular.js/commit/%s)';
|
||||
|
||||
var EMPTY_COMPONENT = '$$';
|
||||
var MAX_SUBJECT_LENGTH = 80;
|
||||
|
||||
|
||||
var warn = function() {
|
||||
@@ -54,11 +53,6 @@ var parseRawCommit = function(raw) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (match[3].length > MAX_SUBJECT_LENGTH) {
|
||||
warn('Too long subject: %s %s', msg.hash, msg.subject);
|
||||
match[3] = match[3].substr(0, MAX_SUBJECT_LENGTH);
|
||||
}
|
||||
|
||||
msg.type = match[1];
|
||||
msg.component = match[2];
|
||||
msg.subject = match[3];
|
||||
|
||||
@@ -12,7 +12,7 @@ var fs = require('fs');
|
||||
var util = require('util');
|
||||
|
||||
|
||||
var MAX_LENGTH = 70;
|
||||
var MAX_LENGTH = 100;
|
||||
var PATTERN = /^(?:fixup!\s*)?(\w*)(\(([\w\$\.\-\*/]*)\))?\: (.*)$/;
|
||||
var IGNORED = /^WIP\:/;
|
||||
var TYPES = {
|
||||
|
||||
@@ -38,12 +38,11 @@ describe('validate-commit-msg.js', function() {
|
||||
});
|
||||
|
||||
|
||||
it('should validate 70 characters length', function() {
|
||||
var msg = 'fix($compile): something super mega extra giga tera long, maybe even longer... ' +
|
||||
'way over 80 characters';
|
||||
it('should validate 100 characters length', function() {
|
||||
var msg = "fix($compile): something super mega extra giga tera long, maybe even longer and longer and longer... ";
|
||||
|
||||
expect(m.validateMessage(msg)).toBe(INVALID);
|
||||
expect(errors).toEqual(['INVALID COMMIT MSG: is longer than 70 characters !']);
|
||||
expect(errors).toEqual(['INVALID COMMIT MSG: is longer than 100 characters !']);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user