Skip to content

ci: align commitlint config across pre-commit and CI#854

Open
nielspardon wants to merge 1 commit into
substrait-io:mainfrom
nielspardon:align-commitlint-config
Open

ci: align commitlint config across pre-commit and CI#854
nielspardon wants to merge 1 commit into
substrait-io:mainfrom
nielspardon:align-commitlint-config

Conversation

@nielspardon

Copy link
Copy Markdown
Member

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.js the single source of truth, mirroring the substrait repo:

  • .commitlintrc.js now extends @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 the Updates the requirements on … to permit the latest version. pattern that substrait has but we were missing.
  • .github/workflows/pr_title.yaml no longer generates a config inline. It checks out the repo and runs commitlint against the checked-in config. Under pull_request_target, actions/checkout defaults to the trusted base branch, so a PR cannot supply its own commitlint rules.
  • .pre-commit-config.yaml gains additional_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 prompt block was dropped to match substrait's config.

Closes #640

🤖 Generated with Claude Code

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>
@nielspardon

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: loosen commitlint restrictions

1 participant