Skip to content

fix(core): ignore comments #106

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

Merged
merged 1 commit into from
Nov 2, 2017
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
2 changes: 1 addition & 1 deletion @commitlint/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@
"xo": "0.18.2"
},
"dependencies": {
"@marionebl/conventional-commits-parser": "^3.0.0",
"@marionebl/git-raw-commits": "^1.2.0",
"@marionebl/sander": "^0.6.0",
"babel-runtime": "^6.23.0",
"chalk": "^2.0.1",
"conventional-changelog-angular": "^1.3.3",
"conventional-commits-parser": "^1.3.0",
"cosmiconfig": "^3.0.1",
"find-up": "^2.1.0",
"franc": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/core/src/library/parse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {sync} from 'conventional-commits-parser';
import {sync} from '@marionebl/conventional-commits-parser';
import defaultChangelogOpts from 'conventional-changelog-angular';

export default parse;
Expand Down
16 changes: 16 additions & 0 deletions @commitlint/core/src/library/parse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,19 @@ test('supports scopes with /', async t => {
t.is(actual.scope, 'some/scope');
t.is(actual.subject, 'subject');
});

test('ignores comments', async t => {
const message = 'type(some/scope): subject\n# some comment';
const actual = await parse(message);
t.is(actual.body, null);
t.is(actual.footer, null);
t.is(actual.subject, 'subject');
});

test('registers inline #', async t => {
const message =
'type(some/scope): subject #reference\n# some comment\nthings #reference';
const actual = await parse(message);
t.is(actual.subject, 'subject #reference');
t.is(actual.body, 'things #reference');
});
24 changes: 12 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@
dependencies:
arrify "^1.0.1"

"@marionebl/conventional-commits-parser@^3.0.0":
version "3.0.0"
resolved "https://registry.npmjs.org/@marionebl/conventional-commits-parser/-/conventional-commits-parser-3.0.0.tgz#9da29b4d2c8f05c0f9cdd02936713b8096c958d3"
dependencies:
JSONStream "^1.0.4"
is-text-path "^1.0.0"
lodash "^4.2.1"
meow "^3.3.0"
split2 "^2.0.0"
through2 "^2.0.0"
trim-off-newlines "^1.0.0"

"@marionebl/git-raw-commits@^1.2.0":
version "1.2.0"
resolved "https://registry.npmjs.org/@marionebl/git-raw-commits/-/git-raw-commits-1.2.0.tgz#7cd8a6dfc09a96df98d8fbe9175c5971cc07c82b"
Expand Down Expand Up @@ -1849,18 +1861,6 @@ conventional-commits-filter@^1.0.0:
is-subset "^0.1.1"
modify-values "^1.0.0"

conventional-commits-parser@^1.3.0:
version "1.3.0"
resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-1.3.0.tgz#e327b53194e1a7ad5dc63479ee9099a52b024865"
dependencies:
JSONStream "^1.0.4"
is-text-path "^1.0.0"
lodash "^4.2.1"
meow "^3.3.0"
split2 "^2.0.0"
through2 "^2.0.0"
trim-off-newlines "^1.0.0"

conventional-commits-parser@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.0.0.tgz#71d01910cb0a99aeb20c144e50f81f4df3178447"
Expand Down