Skip to content

Commit

Permalink
feat(rule-header-length): show current header length
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc authored and marionebl committed Jan 31, 2019
1 parent acd86e6 commit 6d61c4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion @commitlint/rules/src/header-max-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {maxLength} from '@commitlint/ensure';
export default (parsed, when, value) => {
return [
maxLength(parsed.header, value),
`header must not be longer than ${value} characters`
`header must not be longer than ${value} characters, current length is ${
parsed.header.length
}`
];
};
4 changes: 3 additions & 1 deletion @commitlint/rules/src/header-min-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import {minLength} from '@commitlint/ensure';
export default (parsed, when, value) => {
return [
minLength(parsed.header, value),
`header must not be shorter than ${value} characters`
`header must not be shorter than ${value} characters, current length is ${
parsed.header.length
}`
];
};

0 comments on commit 6d61c4f

Please sign in to comment.