Skip to content

Commit

Permalink
chore(validate-commit-msg.js): increase the max line limit for commit…
Browse files Browse the repository at this point in the history
… messages from 70 to 100
  • Loading branch information
IgorMinar committed Oct 24, 2013
1 parent 82dec9b commit 1ae34aa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
6 changes: 0 additions & 6 deletions changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion validate-commit-msg.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
7 changes: 3 additions & 4 deletions validate-commit-msg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 !']);
});


Expand Down

0 comments on commit 1ae34aa

Please sign in to comment.