Skip to content

Commit

Permalink
fix: subject-rule-stop rule bugfix
Browse files Browse the repository at this point in the history
Fixes #3530
  • Loading branch information
tehraninasab committed Feb 12, 2023
1 parent dfc5db4 commit ae01850
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions @commitlint/rules/src/subject-full-stop.ts
Expand Up @@ -6,12 +6,14 @@ export const subjectFullStop: SyncRule<string> = (
when = 'always',
value = '.'
) => {
const input = parsed.subject;

if (!input) {
let colonIndex = parsed.header.indexOf(':');
if (colonIndex > 0 && colonIndex === parsed.header.length - 1) {
return [true];
}

const input = parsed.header;

const negated = when === 'never';
const hasStop = input[input.length - 1] === value;

Expand Down

0 comments on commit ae01850

Please sign in to comment.