redux-form-input-masks
Advanced tools
Comparing version 0.3.10 to 0.3.11
@@ -0,1 +1,9 @@ | ||
<a name="0.3.11"></a> | ||
## [0.3.11](https://github.com/renato-bohler/redux-form-input-masks/compare/v0.3.10...v0.3.11) (2018-02-20) | ||
### Bug Fixes | ||
* **dangerfile:** adds new rules to commit message validation ([1cef917](https://github.com/renato-bohler/redux-form-input-masks/commit/1cef917)) | ||
<a name="0.3.10"></a> | ||
@@ -7,4 +15,13 @@ ## [0.3.10](https://github.com/renato-bohler/redux-form-input-masks/compare/v0.3.9...v0.3.10) (2018-02-20) | ||
* **docs:** adds theme-color to the documentations ([9da97dc](https://github.com/renato-bohler/redux-form-input-masks/commit/9da97dc)) | ||
* **travis:** changes build:docs script to before_deploy ([c5b8cc2](https://github.com/renato-bohler/redux-form-input-masks/commit/c5b8cc2)) | ||
<a name="0.3.10"></a> | ||
## [0.3.10](https://github.com/renato-bohler/redux-form-input-masks/compare/v0.3.9...v0.3.10) (2018-02-20) | ||
### Bug Fixes | ||
* **travis:** changes build:docs script to before_deploy ([c5b8cc2](https://github.com/renato-bohler/redux-form-input-masks/commit/c5b8cc2)) | ||
<a name="0.3.9"></a> | ||
@@ -11,0 +28,0 @@ ## [0.3.9](https://github.com/renato-bohler/redux-form-input-masks/compare/v0.3.8...v0.3.9) (2018-02-20) |
@@ -9,4 +9,5 @@ // eslint-disable-next-line | ||
/* eslint-disable */ | ||
// Convention: <header><blank line><body><blank line><footer> | ||
// where <header> = <type>(<scope>): <subject> or <type>: <subject> | ||
// https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/master/convention.md | ||
// <type>(<scope>): <subject> or <type>: <subject> | ||
const headerRegex = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.{1,}\))?: (.{1,})/; | ||
@@ -17,2 +18,5 @@ /* eslint-enable */ | ||
const commitIdentificator = `Commit ${sha}`; | ||
const errorMessage = | ||
`${commitIdentificator} message does not comply with` + | ||
` the conventional-changelog-standard conventions.`; | ||
@@ -23,9 +27,33 @@ if (!msg) { | ||
// checks for <header> | ||
if (!headerRegex.test(msg)) { | ||
return ( | ||
`${commitIdentificator} message does not comply with` + | ||
` the conventional-changelog-standard conventions` | ||
`${errorMessage} Line #1 should be \`<type>(<scope>): <subject>\` or ` + | ||
`\`<type>: <subject>\`.` | ||
); | ||
} | ||
const msgLines = msg.split('\n'); | ||
const hasTextRegex = /([^\W\_]){1,}/; | ||
// checks for <blank line> between <header> and <body> | ||
if (msgLines.length > 1 && msgLines[1] !== '') { | ||
return `${errorMessage} Line #2 should be \`<blank line>\`.`; | ||
} | ||
// checks for <body> | ||
if (msgLines.length > 2 && !hasTextRegex.test(msgLines[2])) { | ||
return `${errorMessage} Line #3 should be \`<body>\` (with text).`; | ||
} | ||
// checks for <blank line> between <body> and <footer> | ||
if (msgLines.length > 3 && msgLines[3] !== '') { | ||
return `${errorMessage} Line #4 should be \`<blank line>\`.`; | ||
} | ||
// checks for <footer> | ||
if (msgLines.length > 4 && !hasTextRegex.test(msgLines[4])) { | ||
return `${errorMessage} Line #3 should be \`<footer>\` with text.`; | ||
} | ||
return undefined; | ||
@@ -32,0 +60,0 @@ }; |
{ | ||
"name": "redux-form-input-masks", | ||
"version": "0.3.10", | ||
"version": "0.3.11", | ||
"description": "Input masking with redux-form made easy", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
114902
1137