Skip to content

Commit

Permalink
feat(rule names): change rule names to kebab-case
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Agius committed Mar 27, 2017
1 parent 380fb4c commit ca8e77e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
15 changes: 6 additions & 9 deletions config/speedy-commit-msg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"rules": {
"message": {
"noUnscoped": false,
"maxLength": 75
"max-length": 75
},
"type": {
"validTypes": [
"valid-types": [
"amend",
"feat",
"fix",
Expand All @@ -19,14 +18,12 @@
]
},
"scope": {
"noSpace": false,
"noDash": true,
"noUnderscore": true
"no-dash": true,
"no-underscore": true
},
"subject": {
"noPeriodAtEnd": true,
"noUpperFirst": true,
"noLowerFirst": false
"no-period-at-end": true,
"no-upper-first": true
}
}
}
6 changes: 3 additions & 3 deletions src/validator/validator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ describe("validateSpec", () => {
const CONFIG: config.ConfigData = {
"rules": {
"message": {
"noUnscoped": false
"no-unscoped": false
},
"type": {
"validTypes": [
"valid-types": [
"chore",
"feat"
]
},
"scope": {
"noDash": true
"no-dash": true
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/validator/validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export namespace Validator {
return;
}

const result = (_.get(Rules, key) as Function)
const result = (_.get(Rules, _.camelCase(key)) as Function)
.call(null, text, messagePart, value) as RulesResult;

if (result.failed) {
Expand Down

0 comments on commit ca8e77e

Please sign in to comment.