diff --git a/README.md b/README.md index adbfece3..79eeef4c 100644 --- a/README.md +++ b/README.md @@ -127,8 +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] > **IDE Autocompletion** diff --git a/commit_check/__init__.py b/commit_check/__init__.py index e3c59b11..341b9f6b 100644 --- a/commit_check/__init__.py +++ b/commit_check/__init__.py @@ -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", diff --git a/docs/configuration.rst b/docs/configuration.rst index 6b42c9b9..4b1495f2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 @@ -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. * - branch - allow_branch_names diff --git a/tests/rule_builder_test.py b/tests/rule_builder_test.py index c4f4763f..8f50a036 100644 --- a/tests/rule_builder_test.py +++ b/tests/rule_builder_test.py @@ -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) @@ -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",