-
Notifications
You must be signed in to change notification settings - Fork 745
ci: Add a conv. commit lint action+config #5598
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| module.exports = { | ||
| extends: ['@commitlint/config-conventional'], | ||
| rules: { | ||
| 'subject-case': [0], | ||
| 'body-max-line-length': [0], | ||
| 'footer-max-line-length': [0], | ||
| 'type-enum': [2, 'always', [ | ||
| 'build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test', | ||
| 'opt', 'internal', 'tests' | ||
| ]] | ||
| }, | ||
| parserPreset: { | ||
| parserOpts: { | ||
| issuePrefixes: ['#'] | ||
| } | ||
| }, | ||
| ignores: [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to ignore this? And what is actually getting ignored? Like conventional commits aren't enforced if the commit includes "Co-authored-by"?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a line by line check, from my local testing. If someone adds a "recommended change" to your PR and you accept it,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, why does it fail that commit? |
||
| (message) => message.includes('Co-authored-by:') | ||
| ] | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these particular rules? What does the
[0]do? Can we just use someone else's config? Like what if we didn't "extend" theconfig-conventionalThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already add this to s2n-quic repo: aws/s2n-quic#2881
The doc for this rule can be found in https://commitlint.js.org/reference/rules-configuration.html#rules-configuration.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed like a reasonable starting point... here is the complete list
@commitlint/config-angular
@commitlint/config-conventional
@commitlint/config-lerna-scopes
@commitlint/config-nx-scopes
@commitlint/config-patternplate
@commitlint/config-workspace-scopes
conventional-changelog-lint-config-atom
conventional-changelog-lint-config-canonical
For subject-case 0 turns this off; I could not sus out a common pattern to past commit subject case; that isn't to say we shouldn't pick one, but I'm trying to ease us into this check. I can also add more doc links if that would help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it seems like the most reasonable starting point is just their default? I understand that it might cause a bit of friction, but one of the benefits of this tooling is the consistency. If we hate it we can always change it 🤷
Some of the ones that we've specified seem less than ideal e.g. allowing
testandtests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this link https://commitlint.js.org/reference/rules-configuration.html#rules-configuration to this file?