Skip to content

Commit f69d108

Browse files
committed
fix: check captialization of the subject line
1 parent a6e5210 commit f69d108

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/lint.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ export function checkMessage(msg: Message, config: Config): void {
2727
);
2828
}
2929

30+
if (
31+
msg.subject.charAt(0).toUpperCase() === msg.subject.charAt(0) &&
32+
!config.upperCase
33+
) {
34+
throw new Error(
35+
`Expected first letter of the subject to be lower case, but got '${msg.subject}'`
36+
);
37+
}
38+
if (
39+
msg.subject.charAt(0).toLowerCase() === msg.subject.charAt(0) &&
40+
config.upperCase
41+
) {
42+
throw new Error(
43+
`Expected first letter of the subject to be upperCase case, but got '${msg.subject}'`
44+
);
45+
}
46+
3047
if (msg.body) {
3148
checkWrap(msg.body, config.bodyWrap);
3249
}

0 commit comments

Comments
 (0)