Skip to content

Commit 91ccb98

Browse files
committed
commitlint: subject-full-stop integration tests
This rule was most of the time not working for us before, because of an upstream bug[1] which we have now fixed [2]. Given that a recent commit[3] upgraded our version of commitlint, we can just add integration tests now and we are done. [1] conventional-changelog/commitlint#3530 [2] conventional-changelog/commitlint#3531 [3] 1975174
1 parent cf7b1be commit 91ccb98

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

commitlint.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ module.exports = {
5454
// * Detect reverts which have not been elaborated.
5555
// * Reject some stupid obvious words: change, update, modify (if first word after colon, error; otherwise warning).
5656
// * Think of how to reject this shitty commit message: https://github.com/nblockchain/NOnion/pull/34/commits/9ffcb373a1147ed1c729e8aca4ffd30467255594
57-
// * Title should not have dot at the end.
5857
// * Workflow: detect if wip commit in a branch not named "wip/*" or whose name contains "squashed".
5958
// * Detect if commit hash mention in commit msg actually exists in repo.
6059
// * Detect scope(sub-scope) in the title that doesn't include scope part (e.g., writing (bar) instead of foo(bar))

commitlint/integration.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,17 @@ test("body-leading-blank1", () => {
1212
let bodyLeadingBlank1 = runCommitLintOnMsg(commitMsgWithoutEmptySecondLine);
1313
expect(bodyLeadingBlank1.status).not.toBe(0);
1414
});
15+
16+
test("subject-full-stop1", () => {
17+
let commitMsgWithEndingDotInTitle = "foo/bar: bla bla blah.";
18+
let subjectFullStop1 = runCommitLintOnMsg(commitMsgWithEndingDotInTitle);
19+
expect(subjectFullStop1.status).not.toBe(0);
20+
});
21+
22+
test("subject-full-stop2", () => {
23+
let commitMsgWithoutEndingDotInTitle = "foo/bar: bla bla blah";
24+
let subjectFullStop2 = runCommitLintOnMsg(
25+
commitMsgWithoutEndingDotInTitle
26+
);
27+
expect(subjectFullStop2.status).toBe(0);
28+
});

0 commit comments

Comments
 (0)