Skip to content

Commit 277f44b

Browse files
committed
commitlint/plugins: improve a couple of err msgs
1 parent a4f6025 commit 277f44b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

commitlint/plugins.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export abstract class Plugins {
280280
!Helpers.isProperNoun(firstWord);
281281
return [
282282
!offence,
283-
`Please start the title with an upper-case letter if there is no area in the title.` +
283+
`Please start the title with an uppercase letter if you haven't specified any area/scope.` +
284284
Helpers.errMessageSuffix,
285285
];
286286
}
@@ -328,17 +328,18 @@ export abstract class Plugins {
328328

329329
let colonFirstIndex = headerStr.indexOf(":");
330330

331+
let firstWord = "";
331332
if (colonFirstIndex > 0 && headerStr.length > colonFirstIndex) {
332333
let subject = headerStr.substring(colonFirstIndex + 1).trim();
333334
if (subject != null && subject.length > 1) {
334-
let firstWord = subject.trim().split(" ")[0];
335+
firstWord = subject.trim().split(" ")[0];
335336
offence = Helpers.wordIsStartOfSentence(firstWord);
336337
}
337338
}
338339

339340
return [
340341
!offence,
341-
`Please use lowercase as the first letter for your subject, i.e. the text after your area/scope.` +
342+
`Please use lowercase as the first letter for your subject, i.e. the text after your area/scope (note: there is a chance that this rule is yielding a false positive in case the word '${firstWord}' is a name and must be capitalized; in which case please just reword the subject to make this word not be the first, sorry).` +
342343
Helpers.errMessageSuffix,
343344
];
344345
}

0 commit comments

Comments
 (0)