Skip to content

Commit

Permalink
commitlint: subject-full-stop integration tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
knocte committed Feb 14, 2023
1 parent cf7b1be commit 91ccb98
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion commitlint.config.ts
Expand Up @@ -54,7 +54,6 @@ module.exports = {
// * Detect reverts which have not been elaborated.
// * Reject some stupid obvious words: change, update, modify (if first word after colon, error; otherwise warning).
// * Think of how to reject this shitty commit message: https://github.com/nblockchain/NOnion/pull/34/commits/9ffcb373a1147ed1c729e8aca4ffd30467255594
// * Title should not have dot at the end.
// * Workflow: detect if wip commit in a branch not named "wip/*" or whose name contains "squashed".
// * Detect if commit hash mention in commit msg actually exists in repo.
// * Detect scope(sub-scope) in the title that doesn't include scope part (e.g., writing (bar) instead of foo(bar))
Expand Down
14 changes: 14 additions & 0 deletions commitlint/integration.test.ts
Expand Up @@ -12,3 +12,17 @@ test("body-leading-blank1", () => {
let bodyLeadingBlank1 = runCommitLintOnMsg(commitMsgWithoutEmptySecondLine);
expect(bodyLeadingBlank1.status).not.toBe(0);
});

test("subject-full-stop1", () => {
let commitMsgWithEndingDotInTitle = "foo/bar: bla bla blah.";
let subjectFullStop1 = runCommitLintOnMsg(commitMsgWithEndingDotInTitle);
expect(subjectFullStop1.status).not.toBe(0);
});

test("subject-full-stop2", () => {
let commitMsgWithoutEndingDotInTitle = "foo/bar: bla bla blah";
let subjectFullStop2 = runCommitLintOnMsg(
commitMsgWithoutEndingDotInTitle
);
expect(subjectFullStop2.status).toBe(0);
});

0 comments on commit 91ccb98

Please sign in to comment.