ci: align commitlint config across pre-commit and CI#854
Open
nielspardon wants to merge 1 commit into
Open
Conversation
The PR title check workflow generated its own throwaway commitlint config inline, while .commitlintrc.js (used by the local pre-commit hook) maintained a separate, stricter rule set. The two diverged so local commits were validated differently than PR titles in CI. Make .commitlintrc.js the single source of truth, mirroring the substrait repo: extend @commitlint/config-conventional, loosen the length rules, and ignore dependabot messages. The workflow now checks out the repo and runs commitlint against this checked-in config instead of generating one. Add @commitlint/config-conventional as an additional_dependency so the local pre-commit hook can resolve the extended config. Closes substrait-io#640 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
This should make the configuration consistent. If I read #640 correctly then we may actually remove the pre-commit configuration for commitlint since Ben suggests to not check commits but PR title / description only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PR title check workflow generated its own throwaway commitlint config inline, while
.commitlintrc.js(used by the local pre-commit hook) maintained a separate, stricter rule set. The two diverged, so local commits were validated differently than PR titles in CI.This makes
.commitlintrc.jsthe single source of truth, mirroring the substrait repo:.commitlintrc.jsnowextends@commitlint/config-conventional(which supplies the same type list, case, and length rules that were previously hand-maintained), loosens the body/footer length rules, and ignores dependabot messages — including theUpdates the requirements on … to permit the latest version.pattern that substrait has but we were missing..github/workflows/pr_title.yamlno longer generates a config inline. It checks out the repo and runscommitlintagainst the checked-in config. Underpull_request_target,actions/checkoutdefaults to the trusted base branch, so a PR cannot supply its own commitlint rules..pre-commit-config.yamlgainsadditional_dependencies: ['@commitlint/config-conventional']so the local commit-msg hook can resolve the now-extended config (the hook only bundles@commitlint/cli).Notes
Local commits now use the same loosened length rules as CI rather than the old strict 100-char limits — that is the intended convergence, since CI was the effective authority anyway. The commitizen
promptblock was dropped to match substrait's config.Closes #640
🤖 Generated with Claude Code