commitlint icon indicating copy to clipboard operation
commitlint copied to clipboard

feat: allow ignoring commits from certain users

Open jgresty opened this issue 2 years ago • 2 comments

Expected Behavior

Some commits are raised by bots or other scripts that may not necessarily pass strict rulesets. It should be possible to bypass linting commits by some specified users so that commits made by some automated process do not need to be manually fixed up.

Current Behavior

It is only possible to ignore commits by the content of the messages.

Affected packages

  • [ ] cli
  • [ ] core
  • [ ] prompt
  • [ ] config-angular

Possible Solution

Extend the ignores config matcher to include additional metadata. For this use case only user is required but there may be other use cases:

ignores: [
  (message, user) => user.includes('[bot]@users.noreply.github.com')
]

Context

We use automated processes to upgrade pull requests, the commits raised in this way contain a URL that sometimes is longer than the maximum line length. Since these are automated we don't particularly care about perfect formatting so want to ignore any commits raised by bot users.

jgresty avatar Sep 18 '23 08:09 jgresty

.... irrespective of the benefits of being able to ignore bots, it feels like it would be good to also ignore URLs when counting the line length...

Clockwork-Muse avatar Sep 27 '23 16:09 Clockwork-Muse

.... irrespective of the benefits of being able to ignore bots, it feels like it would be good to also ignore URLs when counting the line length...

see #2112

sdavids avatar Apr 15 '24 16:04 sdavids