Skip to content

Commit

Permalink
commitlint(plugins): fix issue#124
Browse files Browse the repository at this point in the history
Add exception to bodySoftMaxLineLength when line exceeds max
length but ends with a git commit hash.
Fixes nblockchain#124.
  • Loading branch information
webwarrior-ws committed Jul 17, 2023
1 parent f32fa77 commit 2ba7d85
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commitlint/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,12 @@ export abstract class Plugins {

let lineIsFooterNote = Helpers.isFooterNote(line);

if (!isUrl && !lineIsFooterNote) {
let commitHashAtTheEndMatch = line.match(`([0-9a-f]{5,40})\.?$`);
let endsWithCommitHashButRestIsNotTooLong =
commitHashAtTheEndMatch !== null
&& commitHashAtTheEndMatch.index < bodyMaxLineLength;

if (!isUrl && !lineIsFooterNote || endsWithCommitHashButRestIsNotTooLong) {
offence = true;
break;
}
Expand Down

0 comments on commit 2ba7d85

Please sign in to comment.