Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,22 @@ ai_attribution = "forbid"
[branch]
# https://conventionalbranch.org
conventional_branch = true
allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix"]
allow_branch_types = [
"feature",
"bugfix",
"hotfix",
"release",
"chore",
"feat",
"fix",
"build",
"ci",
"docs",
"perf",
"refactor",
"style",
"test",
]
```

> [!TIP]
Expand Down
7 changes: 7 additions & 0 deletions commit_check/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
"chore",
"feat",
"fix",
"build",
"ci",
"docs",
"perf",
"refactor",
"test",
"style",
# AI agent prefixes (conventional branch spec v1.1.0)
"ai",
"claude",
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Example Configuration
[branch]
# https://conventionalbranch.org
conventional_branch = true
allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix"]
allow_branch_types = ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix", "build", "ci", "docs", "perf", "refactor", "test", "style"]
# allow_branch_names = [] # Optional - additional standalone branch names (e.g., ["develop", "staging"])
# require_rebase_target = "main" # Optional - no rebase requirement by default
# ignore_authors = [] # Optional - no authors ignored by default
Expand Down Expand Up @@ -433,7 +433,7 @@ Options Table Description
* - branch
- allow_branch_types
- list[str]
- ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix"]
- ["feature", "bugfix", "hotfix", "release", "chore", "feat", "fix", "build", "ci", "docs", "perf", "refactor", "test", "style"]
- Allowed branch types when conventional_branch is true. AI agent prefixes (``ai/``, ``claude/``, ``codex/``, ``copilot/``, ``cursor/``) and bot prefixes (``dependabot/``) are also included by default.
Comment on lines +436 to 437

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Synchronize the documented default with DEFAULT_BRANCH_TYPES.

commit_check/__init__.py also includes ai, claude, codex, copilot, cursor, dependabot, and renovate. The default list at Line 436 omits these values, although Line 437 says they are included by default. Add the missing prefixes or label this row as a partial example.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/configuration.rst` around lines 436 - 437, Update the documented default
branch-type list in the configuration section to match DEFAULT_BRANCH_TYPES,
adding ai, claude, codex, copilot, cursor, dependabot, and renovate; keep the
statement that these prefixes are included by default accurate.

* - branch
- allow_branch_names
Expand Down
15 changes: 15 additions & 0 deletions tests/rule_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ def test_ai_agent_and_bot_branch_types_in_default(self):
assert "cursor" in DEFAULT_BRANCH_TYPES
assert "dependabot" in DEFAULT_BRANCH_TYPES
assert "renovate" in DEFAULT_BRANCH_TYPES
assert "build" in DEFAULT_BRANCH_TYPES
assert "ci" in DEFAULT_BRANCH_TYPES
assert "docs" in DEFAULT_BRANCH_TYPES
assert "perf" in DEFAULT_BRANCH_TYPES
assert "refactor" in DEFAULT_BRANCH_TYPES
assert "style" in DEFAULT_BRANCH_TYPES
assert "test" in DEFAULT_BRANCH_TYPES

config = {"branch": {"conventional_branch": True}}
builder = RuleBuilder(config)
Expand All @@ -236,6 +243,14 @@ def test_ai_agent_and_bot_branch_types_in_default(self):
assert rule is not None

valid_branches = [
# Conventional branch types matching default commit types
"build/update-ci-image",
"ci/github-actions",
"docs/update-readme",
"perf/optimize-parser",
"refactor/simplify-engine",
"style/format-code",
"test/add-api-tests",
# AI agent branches
"ai/refactor-auth-flow",
"claude/stoic-hypatia-v65p1f",
Expand Down