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 Aug 2, 2023
1 parent a8e8ea6 commit b21edbf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion commitlint/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,15 @@ export abstract class Plugins {

let lineIsFooterNote = Helpers.isFooterNote(line);

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

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

0 comments on commit b21edbf

Please sign in to comment.