Skip to content

Commit

Permalink
Fixup style
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Jan 16, 2024
1 parent 4449b73 commit 1c4685c
Showing 1 changed file with 40 additions and 80 deletions.
120 changes: 40 additions & 80 deletions commitlint/plugins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ function runCommitLintOnMsg(inputMsg: string) {
}

test("body-prose1", () => {
let commitMsgWithLowercaseBodyStart =
`foo: this is only a title
let commitMsgWithLowercaseBodyStart = `foo: this is only a title
bla blah bla.`;

Expand All @@ -15,8 +14,7 @@ bla blah bla.`;
});

test("body-prose2", () => {
let commitMsgWithNumbercaseBodyStart =
`foo: this is only a title
let commitMsgWithNumbercaseBodyStart = `foo: this is only a title
1234 bla blah bla.`;

Expand All @@ -25,8 +23,7 @@ test("body-prose2", () => {
});

test("body-prose3", () => {
let commitMsgWithUrl =
`foo: this is only a title
let commitMsgWithUrl = `foo: this is only a title
someUrl://blahblah.com`;

Expand All @@ -37,8 +34,7 @@ someUrl://blahblah.com`;
});

test("body-prose4", () => {
let commitMsgWithFootnoteUrl =
`foo: this is only a title
let commitMsgWithFootnoteUrl = `foo: this is only a title
Bla blah[1] bla.
Expand All @@ -51,8 +47,7 @@ Bla blah[1] bla.
});

test("body-prose5", () => {
let commitMsgWithBugUrl =
`foo: this is only a title
let commitMsgWithBugUrl = `foo: this is only a title
Fixes someUrl://blahblah.com`;

Expand All @@ -72,8 +67,7 @@ test("body-prose6", () => {
});

test("body-prose7", () => {
let commitMsgWithParagraphEndingWithColon =
`foo: this is only a title
let commitMsgWithParagraphEndingWithColon = `foo: this is only a title
Bar baz:
Expand All @@ -86,8 +80,7 @@ Blah blah.`;
});

test("body-prose8", () => {
let commitMsgWithCoAuthoredByTagThatIsObviouslyNotAParagraph =
`foo: this is only a title
let commitMsgWithCoAuthoredByTagThatIsObviouslyNotAParagraph = `foo: this is only a title
Co-authored-by: Jon Doe <jondoe@example.com>`;

Expand All @@ -100,8 +93,7 @@ Co-authored-by: Jon Doe <jondoe@example.com>`;
});

test("body-prose9", () => {
let commitMsgWithCommitUrlAtTheEndOfBodyParagraph =
`foo: this is only a title
let commitMsgWithCommitUrlAtTheEndOfBodyParagraph = `foo: this is only a title
Foo bar:
https://github.com/username/repo/commit/1234567891234567891234567891234567891234`;
Expand Down Expand Up @@ -135,8 +127,7 @@ test("body-prose11", () => {
});

test("body-prose12", () => {
let commitMsgWithBugUrl =
`foo: this is only a title
let commitMsgWithBugUrl = `foo: this is only a title
Closes someUrl://blahblah.com`;

Expand All @@ -147,8 +138,7 @@ Closes someUrl://blahblah.com`;
});

test("body-prose13", () => {
let commitMsgWithParagraphEndingWithQuestionMark =
`foo: this is only a title
let commitMsgWithParagraphEndingWithQuestionMark = `foo: this is only a title
Increase verbosity, because why not?
Expand All @@ -163,8 +153,7 @@ Blah blah.`;
});

test("body-prose14", () => {
let commitMsgWithParagraphEndingWithExclamationMark =
`foo: this is only a title
let commitMsgWithParagraphEndingWithExclamationMark = `foo: this is only a title
Increase verbosity, because why not!
Expand All @@ -179,8 +168,7 @@ Blah blah.`;
});

test("body-prose15", () => {
let commitMsgWithParagraphEndingInParentheses =
`foo: this is only a title
let commitMsgWithParagraphEndingInParentheses = `foo: this is only a title
Paragraph begin. (Some text inside parens.)
Expand All @@ -201,8 +189,7 @@ Blah blah.`;
});

test("body-prose16", () => {
let commitMsgWithUrlAtTheEndOfParagraph =
`Frontend.XF.Android: switch to SDK-style
let commitMsgWithUrlAtTheEndOfParagraph = `Frontend.XF.Android: switch to SDK-style
Strangely enough when opening the new gwallet.android.sln in
VS4Mac, it asks the user to install the wasm-tools-net6.0
Expand Down Expand Up @@ -363,8 +350,7 @@ test("body-max-line-length7", () => {
});

test("body-max-line-length8", () => {
let commitMsgWithLargeBody =
`Network,TorHandshakes: handle handshake fail
let commitMsgWithLargeBody = `Network,TorHandshakes: handle handshake fail
--- Line between dashes ---
A very long line. A very long line. A very long line. A very long line. A very long line. A very long line.`;
Expand All @@ -375,8 +361,7 @@ A very long line. A very long line. A very long line. A very long line. A very l

test("body-max-line-length9", () => {
// see https://github.com/nblockchain/conventions/issues/124
let commitMsgWithLargeBody =
`GrpcService: fix some logging nits
let commitMsgWithLargeBody = `GrpcService: fix some logging nits
These mistakes were made in 45faeca2f0e7c9c5545f54fb3fcc815f52b8a7cf.`;

Expand All @@ -386,8 +371,7 @@ These mistakes were made in 45faeca2f0e7c9c5545f54fb3fcc815f52b8a7cf.`;

test("body-max-line-length10", () => {
// see https://github.com/nblockchain/conventions/issues/124
let commitMsgWithLargeBody =
`GrpcService: fix some logging nits
let commitMsgWithLargeBody = `GrpcService: fix some logging nits
These mistakes were made in this GrpcService's RunIntoMeService commit: 45faeca2f0e7c9c5545f54fb3fcc815f52b8a7cf.`;

Expand All @@ -408,8 +392,7 @@ test("body-paragraph-line-min-length1", () => {
});

test("body-paragraph-line-min-length2", () => {
let commitMsgWithCommitUrlAtTheEndOfBodyParagraph =
`foo: this is only a title
let commitMsgWithCommitUrlAtTheEndOfBodyParagraph = `foo: this is only a title
Foo bar:
https://github.com/username/repo/commit/1234567891234567891234567891234567891234`;
Expand Down Expand Up @@ -455,8 +438,7 @@ test("body-paragraph-line-min-length4", () => {
});

test("body-paragraph-line-min-length5", () => {
let commitMsgWithCoAuthoredByTagThatSubceedsBodyMinLineLength =
`foo: this is only a title
let commitMsgWithCoAuthoredByTagThatSubceedsBodyMinLineLength = `foo: this is only a title
Co-authored-by: Jon Doe <shortmail@example.com>
Co-authored-by: Jon Doe <JonDoeEmailAddress@example.com>`;
Expand All @@ -470,8 +452,7 @@ Co-authored-by: Jon Doe <JonDoeEmailAddress@example.com>`;
});

test("body-paragraph-line-min-length6", () => {
let commitMsgThatSubceedsBodyMinLineLength =
`Some title of less than 50 chars
let commitMsgThatSubceedsBodyMinLineLength = `Some title of less than 50 chars
This is a paragraph whose 2nd line is less than 50 chars
but should not make commitlint complain because
Expand All @@ -485,8 +466,7 @@ TheNextWordInThe3rdLineIsTooLongToBePlacedIn2ndLine.`;
});

test("body-paragraph-line-min-length7", () => {
let commitMsgThatSubceedsBodyMinLineLengthButIsLegit =
`Fixed bug (a title of less than 50 chars)
let commitMsgThatSubceedsBodyMinLineLengthButIsLegit = `Fixed bug (a title of less than 50 chars)
These were the steps to reproduce:
Do foo.
Expand Down Expand Up @@ -521,8 +501,7 @@ test("body-paragraph-line-min-length8", () => {
});

test("commit-hash-alone1", () => {
let commitMsgWithCommitUrl =
`foo: this is only a title
let commitMsgWithCommitUrl = `foo: this is only a title
https://github.com/${process.env["GITHUB_REPOSITORY"]}/commit/3ee07243edc30604088a4b04ca525204ea440710`;

Expand All @@ -531,8 +510,7 @@ https://github.com/${process.env["GITHUB_REPOSITORY"]}/commit/3ee07243edc3060408
});

test("commit-hash-alone2", () => {
let commitMsgWithCommitHash =
`foo: this is only a title
let commitMsgWithCommitHash = `foo: this is only a title
This is referring to [1] commit hash.
Expand All @@ -543,8 +521,7 @@ This is referring to [1] commit hash.
});

test("commit-hash-alone3", () => {
let commitMsgWithExternalCommitUrl =
`foo: this is only a title
let commitMsgWithExternalCommitUrl = `foo: this is only a title
https://github.com/anotherOrg/anotherRepo/commit/3ee07243edc30604088a4b04ca525204ea440710`;

Expand All @@ -571,8 +548,7 @@ test("empty-wip-3", () => {
});

test("footer-notes-misplacement-1", () => {
let commitMsgWithRightFooter =
`foo: this is only a title
let commitMsgWithRightFooter = `foo: this is only a title
Bla bla blah[1].
Expand All @@ -585,8 +561,7 @@ Fixes https://some/issue
});

test("footer-notes-misplacement-2", () => {
let commitMsgWithWrongFooter =
`foo: this is only a title
let commitMsgWithWrongFooter = `foo: this is only a title
Fixes https://some/issue
Expand Down Expand Up @@ -638,8 +613,7 @@ test("footer-notes-misplacement-5", () => {
});

test("footer-refs-validity1", () => {
let commmitMsgWithCorrectFooter =
`foo: this is only a title
let commmitMsgWithCorrectFooter = `foo: this is only a title
Bla bla blah[1].
Expand All @@ -650,8 +624,7 @@ Bla bla blah[1].
});

test("footer-refs-validity2", () => {
let commmitMsgWithWrongFooter =
`foo: this is only a title
let commmitMsgWithWrongFooter = `foo: this is only a title
Bla bla blah.
Expand All @@ -662,8 +635,7 @@ Bla bla blah.
});

test("footer-refs-validity3", () => {
let commmitMsgWithWrongFooter =
`foo: this is only a title
let commmitMsgWithWrongFooter = `foo: this is only a title
Bla bla blah[1], and after that [2], then [3].
Expand All @@ -688,8 +660,7 @@ test("footer-refs-validity4", () => {
});

test("footer-refs-validity5", () => {
let commmitMsgWithEOLFooter =
`foo: this is only a title
let commmitMsgWithEOLFooter = `foo: this is only a title
Bla bla blah[1].
Expand Down Expand Up @@ -902,8 +873,7 @@ Blah blah #123.`;
});

test("proper-issue-refs2", () => {
let commitMsgWithFullUrl =
`foo: blah blah
let commitMsgWithFullUrl = `foo: blah blah
Fixes someUrl://blah.blah/158`;

Expand All @@ -921,8 +891,7 @@ test("proper-issue-refs3", () => {
});

test("proper-issue-refs4", () => {
let commitMsgWithFullUrl =
`foo: blah blah
let commitMsgWithFullUrl = `foo: blah blah
Some paragraph text with a ref[1].
Expand All @@ -933,8 +902,7 @@ Some paragraph text with a ref[1].
});

test("proper-issue-refs5", () => {
let commitMsgWithHashtagRef =
`foo: blah blah
let commitMsgWithHashtagRef = `foo: blah blah
#123 bug is fixed.`;

Expand Down Expand Up @@ -1044,8 +1012,7 @@ test("too-many-spaces1", () => {
});

test("too-many-spaces2", () => {
let commitMsgWithTooManySpacesInBody =
`foo: this is only a title
let commitMsgWithTooManySpacesInBody = `foo: this is only a title
Bla blah bla.`;

Expand All @@ -1064,8 +1031,7 @@ test("too-many-spaces3", () => {
});

test("too-many-spaces4", () => {
let commitMsgWithTwoSpacesAfterSentence =
`foo: this is only a title
let commitMsgWithTwoSpacesAfterSentence = `foo: this is only a title
Bla blah. Blah bla.`;

Expand All @@ -1076,8 +1042,7 @@ Bla blah. Blah bla.`;
});

test("too-many-spaces5", () => {
let commitMsgWithThreeSpacesAfterSentence =
`foo: this is only a title
let commitMsgWithThreeSpacesAfterSentence = `foo: this is only a title
Bla blah. Blah bla.`;

Expand All @@ -1088,8 +1053,7 @@ Bla blah. Blah bla.`;
});

test("trailing-whitespace1", () => {
let commitMsgWithNoTrailingWhiteSpace =
`foo: this is only a title
let commitMsgWithNoTrailingWhiteSpace = `foo: this is only a title
Bla blah bla.`;

Expand All @@ -1100,8 +1064,7 @@ Bla blah bla.`;
});

test("trailing-whitespace2", () => {
let commitMsgWithTrailingWhiteSpaceInTitleEnd =
`foo: title
let commitMsgWithTrailingWhiteSpaceInTitleEnd = `foo: title
Bla blah bla.`;

Expand All @@ -1112,8 +1075,7 @@ Bla blah bla.`;
});

test("trailing-whitespace3", () => {
let commitMsgWithTrailingWhiteSpaceInTitleStart =
` foo: title
let commitMsgWithTrailingWhiteSpaceInTitleStart = ` foo: title
Bla blah bla.`;

Expand All @@ -1124,8 +1086,7 @@ Bla blah bla.`;
});

test("trailing-whitespace4", () => {
let commitMsgWithTrailingWhiteSpaceInBodyStart =
`foo: title
let commitMsgWithTrailingWhiteSpaceInBodyStart = `foo: title
Bla blah bla.`;

Expand All @@ -1136,8 +1097,7 @@ test("trailing-whitespace4", () => {
});

test("trailing-whitespace5", () => {
let commitMsgWithTrailingWhiteSpaceInBodyEnd =
`foo: title
let commitMsgWithTrailingWhiteSpaceInBodyEnd = `foo: title
Bla blah bla. `;

Expand Down

0 comments on commit 1c4685c

Please sign in to comment.