defaultIgnores doesn't seem to stop the commit message fixup! from bypassing rules:
module.exports = {
defaultIgnores: false,
rules: {
'subject-empty': [2, 'never']
}
};
Example:
> commitlint -v
8.1.0
> "foo: bar" | commitlint -V
â§— input: foo: bar
✔ found 0 problems, 0 warnings
> "foo:" | commitlint -V
â§— input: foo:
✖ subject may not be empty [subject-empty]
✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
> "foxup!" | commitlint -V
â§— input: foxup!
✖ subject may not be empty [subject-empty]
✖ found 1 problems, 0 warnings
ⓘ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
> "fixup!" | commitlint -V
â§— input: fixup!
✔ found 0 problems, 0 warnings
The message fixup! should fail in the same way as foxup!, as it breaks the subject-empty rule and defaultIgnores has been set to false.
The message fixup! ignores the subject-empty rule.
commitlint.config.js with a single rule to disallow the message fixup! and set defaultIgnores: false _(see above)_echo "fixup!" | commitlint or any other message beginning with fixup!
commitlint.config.js
module.exports = {
defaultIgnores: false,
rules: {
'subject-empty': [2, 'never']
}
};
I want to disallow fixups from being merged into my main branch.
| Executable | Version |
| ---: | :--- |
| commitlint --version | 8.1.0 |
| git --version | git version 2.22.0.windows.1 |
| node --version | v11.2.0 |
Just verified this. We fail to transfer the defaultIgnores from user options to our defaults, this is very much like #668, so the same type of fix applies:
Analogous to
we should do the following:
if (loaded.defaultIgnores) {
opts.defaultIgnores = loaded.defaultIgnores;
}
Want to lend a hand?
@ResDiaryLewis I see your pull request is merged. Is this issue still open?
Hi @YegorZaremba, I'd probably consider the issue to be open until we can use the fix in a release
I've just published 8.2.0, which includes the fix for this issue. Sorry it took a while! Please try it out tell us if you encounter any issues 😄
Most helpful comment
I've just published
8.2.0, which includes the fix for this issue. Sorry it took a while! Please try it out tell us if you encounter any issues 😄