Open felipecrs opened 4 years ago
This goes along with a similar issue #2056, where Dependabot will also make the commit header too long
I don't think this is a bug in Dependabot, but rather it should be easier to make commitlint ignore Dependabot's commits. One solution would be to add an ignores
option to the header-max-length
rule which accepts one or more regular expressions.
Or perhaps it should be smarter when URLs are detected. There is no way to break an URL into multiple lines.
Just found out via https://stackoverflow.com/a/60195181 that commitlint indeed already has an ignores
option:
/*
* Functions that return true if commitlint should ignore the given message.
*/
ignores: [(commit) => commit === ''],
So you can make commitlint ignore Dependabot's commits as follows:
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
ignores: [(message) => /^Bumps \[.+]\(.+\) from .+ to .+\.$/m.test(message)],
}
I think this is covered by https://github.com/dependabot/dependabot-core/issues/1666, so I'm going to close this as a duplicate, feel free to add any context you feel is missing from that issue in the comments there.
@jurre it's not the same thing, this is about body line while the one you refer is about the subject line.
Meant to link to https://github.com/dependabot/dependabot-core/issues/1666
Or perhaps it should be smarter when URLs are detected. There is no way to break an URL into multiple lines.
@felipecrs I don't know how much of a difference this would make for grouped updates. I removed the URLs from the first line of an update to a group of four dependencies and it's still too long.
Interestingly, in a PR which would update five dependencies at once, they are put in a Markdown table instead. Which would work with the URLs removed. Though that PR exceeds the allowed subject length. :upside_down_face:
I feel like an on/off switch for the inclusion of project URLs for dependencies in Dependabot messages might be the most useful solution. Or, better yet, a differentiation between Git commit messages and PR (meta) info. That Markdown table for grouped dependencies isn't useful outside of Markdown-based UIs, and neither are Markdown-formatted URLs.
Edit: A combo solution could be a config option for commit message verbosity – "minimal, plain text" (without URLs) vs. "verbose" (Markdown-formatted, with URLs).
Dependabot commit messages body line lengths do not conform with
commitlint
's defaults.Take a look at https://github.com/felipecassiors/megatar/pull/13 and https://github.com/felipecassiors/megatar/pull/14
It fails with:
https://github.com/felipecassiors/megatar/pull/13/checks?check_run_id=969926394#step:4:19