Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/config/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
Copy link
Contributor

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" the config-conventional

Copy link
Contributor

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.

Copy link
Contributor Author

@dougch dougch Nov 4, 2025

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?

Copy link
Contributor

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 test and tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'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: [
Copy link
Contributor

Choose a reason for hiding this comment

The 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"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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, Co-authored-by gets added to the commit message. With-out this present, you would need to rebase and strip these out for this check to pass; example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why does it fail that commit?

Co-authored-by: maddeleine <[email protected]>

(message) => message.includes('Co-authored-by:')
]
};

10 changes: 10 additions & 0 deletions .github/workflows/ci_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,13 @@ jobs:
exit 1
- name: Success
run: echo "All nix files passed format check"
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: true
- uses: ahmadnassri/action-commit-lint@v2
with:
config: ./.github/config/commitlint.config.js

Loading