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 authored and tehraninasab committed Aug 1, 2023
1 parent 4c1dc50 commit 142a2fb
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 142a2fb

Please sign in to comment.