From ace81c053cda690b7c8379e9852f52f16ae368f5 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 18 Oct 2012 03:26:08 -0700 Subject: chore(validate-commit-msg): allow * and - in scope string --- validate-commit-msg.js | 2 +- validate-commit-msg.spec.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/validate-commit-msg.js b/validate-commit-msg.js index 453c56c7..7235b8d9 100755 --- a/validate-commit-msg.js +++ b/validate-commit-msg.js @@ -13,7 +13,7 @@ var util = require('util'); var MAX_LENGTH = 70; -var PATTERN = /^(\w*)(\(([\w\$\.]*)\))?\: (.*)$/; +var PATTERN = /^(\w*)(\(([\w\$\.\-\*]*)\))?\: (.*)$/; var IGNORED = /^WIP\:/; var TYPES = { feat: true, diff --git a/validate-commit-msg.spec.js b/validate-commit-msg.spec.js index 8eb4f3bd..2ea3cf16 100644 --- a/validate-commit-msg.spec.js +++ b/validate-commit-msg.spec.js @@ -29,6 +29,8 @@ describe('validate-commit-msg.js', function() { expect(m.validateMessage('refactor($httpBackend): something')).toBe(VALID); expect(m.validateMessage('test($resource): something')).toBe(VALID); expect(m.validateMessage('chore($controller): something')).toBe(VALID); + expect(m.validateMessage('chore(foo-bar): something')).toBe(VALID); + expect(m.validateMessage('chore(*): something')).toBe(VALID); expect(errors).toEqual([]); }); -- cgit v1.2.3