-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(git): enforce Conventional Commits format in commit message prompt #2123
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
base: main
Are you sure you want to change the base?
Changes from all 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 |
|---|---|---|
|
|
@@ -38,7 +38,10 @@ export function buildCommitMessagePrompt(input: CommitMessagePromptInput) { | |
| ? "Return a JSON object with keys: subject, body, branch." | ||
| : "Return a JSON object with keys: subject, body.", | ||
| "Rules:", | ||
| "- subject must be imperative, <= 72 chars, and no trailing period", | ||
| "- subject must follow Conventional Commits format: type(scope): description", | ||
| "- type must be one of: feat, fix, docs, style, refactor, test, chore", | ||
| "- scope is optional; description is imperative, no trailing period", | ||
| "- full subject line must be <= 72 chars", | ||
|
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. Sanitizer breaks new commit formatLow Severity The prompt now requires Conventional Commits subjects, but Reviewed by Cursor Bugbot for commit b8faa63. Configure here. |
||
| "- body can be empty string or short bullet points", | ||
| ...(wantsBranch | ||
| ? ["- branch must be a short semantic git branch fragment for this change"] | ||
|
|
||


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.
Ambiguous optional scope format
Low Severity
The subject rule presents
type(scope): descriptionas the required shape while also saying scope is optional, without stating the no-scope formtype: description. That can push models toward always inventing a scope or emitting empty parentheses, which is invalid Conventional Commits and weakens the consistency this change aims for.Reviewed by Cursor Bugbot for commit b8faa63. Configure here.