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(is-ignored): ignore "amend!" commits #4024

Merged
merged 2 commits into from
Apr 14, 2024
Merged

fix(is-ignored): ignore "amend!" commits #4024

merged 2 commits into from
Apr 14, 2024

Conversation

chalkygames123
Copy link
Contributor

Description

This PR allows a commit whose subject is prefixed with "amend!" to be ignored.

Motivation and Context

git-commit supports the --fixup=[(amend|reword):]<commit> option, which creates a commit whose subject is prefixed with "amend!". commitlint should ignore this, but currently, it does not.

For more information about the --fixup=[(amend|reword):]<commit> option, please see the git-commit documentation.

Usage examples

n/a

How Has This Been Tested?

According to the contribution guide.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@escapedcat
Copy link
Member

Is this potentially a breaking change?

@chalkygames123
Copy link
Contributor Author

I don't think so because this PR will only widen the type of ignored commits. Users won't be forced to update their configuration for this change.

@escapedcat
Copy link
Member

Yeah, that's always what you think till someone is opening an issue and complains that their setup is behaving differently now.
I looked at the older commits tackling other cases and those all where fixes as well. So I guess we're ok here :)

@knocte wdyt?

@knocte
Copy link
Contributor

knocte commented Apr 14, 2024

Not sure TBH, shouldn't this ignore list be a param list to a rule?

@escapedcat
Copy link
Member

Looks like we already have this?

  /*
   * Array of functions that return true if commitlint should ignore the given message.
   * Given array is merged with predefined functions, which consist of matchers like:
   *
   * - 'Merge pull request', 'Merge X into Y' or 'Merge branch X'
   * - 'Revert X'
   * - 'v1.2.3' (ie semver matcher)
   * - 'Automatic merge X' or 'Auto-merged X into Y'
   *
   * To see full list, check https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/is-ignored/src/defaults.ts.
   * To disable those ignores and run rules always, set `defaultIgnores: false` as shown below.
   */
  ignores: [(commit) => commit === ''],
  /*
   * Whether commitlint uses the default ignore rules, see the description above.
   */
  defaultIgnores: true,
  /*
   * Custom URL to show upon failure
   */

https://commitlint.js.org/reference/configuration.html#configuration-object-example

@knocte
Copy link
Contributor

knocte commented Apr 14, 2024

So then this PR is changing the defaultIgnores?

@escapedcat
Copy link
Member

Yes, it does

@knocte
Copy link
Contributor

knocte commented Apr 14, 2024

LGTM then

@escapedcat escapedcat merged commit 90078f6 into conventional-changelog:master Apr 14, 2024
7 checks passed
@escapedcat
Copy link
Member

🤞

@escapedcat
Copy link
Member

https://github.com/conventional-changelog/commitlint/releases/tag/v19.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants