Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stop truncating the body in presence of dashes #3476

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions @commitlint/parse/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,25 @@ test('registers inline #', async () => {
expect(actual.body).toBe('things #reference');
});

test('keep -side notes- in the body section', async () => {
const header = "type(some/scope): subject"
const body =
"CI on master branch caught this:\n\n" +
"```\n" +
"Unhandled Exception:\n" +
"System.AggregateException: One or more errors occurred. (Some problem when connecting to 'api.mycryptoapi.com/eth')\n\n" +
"--- End of stack trace from previous location where exception was thrown ---\n\n" +
"at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206\n" +
"...\n" +
"```";

const message = header + "\n\n" + body

const actual = await parse(message);

expect(actual.body).toBe(body);
});

test('parses references leading subject', async () => {
const message = '#1 some subject';
const opts = await require('conventional-changelog-angular');
Expand Down
1 change: 1 addition & 0 deletions @commitlint/parse/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default async function parse(
const opts = {
...defaultOpts,
...(parserOpts || {}),
fieldPattern: null
};
const parsed = parser(message, opts) as Commit;
parsed.raw = message;
Expand Down