-
Notifications
You must be signed in to change notification settings - Fork 933
fix: pass defaultIgnores from configuration in @commitlint/cli #771
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
defaultIgnores: false, | ||
rules: { | ||
'subject-empty': [2, 'never'] | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
defaultIgnores: true, | ||
rules: { | ||
'subject-empty': [2, 'never'] | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,6 +318,18 @@ test('should not skip linting if message does not match ignores config', async t | |
t.is(actual.code, 1); | ||
}); | ||
|
||
test('should not skip linting if defaultIgnores is false', async t => { | ||
const cwd = await git.bootstrap('fixtures/default-ignores-false'); | ||
const actual = await cli([], {cwd})('fixup! foo: bar'); | ||
t.is(actual.code, 0); | ||
}); | ||
|
||
test('should skip linting if defaultIgnores is true', async t => { | ||
const cwd = await git.bootstrap('fixtures/default-ignores-false'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you intended to use |
||
const actual = await cli([], {cwd})('fixup! foo: bar'); | ||
t.is(actual.code, 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And I think this should be |
||
}); | ||
|
||
test('should fail for invalid formatters from flags', async t => { | ||
const cwd = await git.bootstrap('fixtures/custom-formatter'); | ||
const actual = await cli(['--format', 'through-flag'], {cwd})('foo: bar'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so when the
defaultIgnores
isfalse
, it should not ignore thefixup! ...
empty subject right? So that means it would fail, instead of pass 😄 (this should bet.is(actual.code, 1);
, a failure code)