Skip to content

Can't disallow fixup! messages #769

Closed
@ResDiaryLewis

Description

@ResDiaryLewis

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

Expected Behavior

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.

Current Behavior

The message fixup! ignores the subject-empty rule.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Steps to Reproduce (for bugs)

  1. Create a commitlint.config.js with a single rule to disallow the message fixup! and set defaultIgnores: false (see above)
  2. Run echo "fixup!" | commitlint or any other message beginning with fixup!
commitlint.config.js ```js module.exports = { defaultIgnores: false, rules: { 'subject-empty': [2, 'never'] } }; ```

Context

I want to disallow fixups from being merged into my main branch.

Your Environment

Executable Version
commitlint --version 8.1.0
git --version git version 2.22.0.windows.1
node --version v11.2.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions