Skip to content

Standardize and enforce branch names#39

Merged
c-vigo merged 6 commits intofeature/37-automate-standardize-repository-setupfrom
feature/38-standardize-branching-strategy-enforcement
Jan 30, 2026
Merged

Standardize and enforce branch names#39
c-vigo merged 6 commits intofeature/37-automate-standardize-repository-setupfrom
feature/38-standardize-branching-strategy-enforcement

Conversation

@c-vigo
Copy link
Contributor

@c-vigo c-vigo commented Jan 30, 2026

Description

Implements initial branching strategy and enforcement for the devcontainer template (issue #38): branch naming convention, pre-commit enforcement, Cursor rules for the issue-to-branch workflow, and integration tests.
This provides a reproducible baseline for branch naming that can be extended with branch protection and CI enforcement in follow-up work.

Related Issue(s)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Test updates

Changes Made

Branch name enforcement (pre-commit)

  • New branch-name hook in pre-commit config enforcing <type>/<issue>-<summary> (e.g. feature/38-standardize-branching-strategy-enforcement).
  • Config updated in root .pre-commit-config.yaml and in assets/workspace/.pre-commit-config.yaml so installed workspaces get the same hook.

Cursor rules

  • .cursor/rules/branch-naming.mdc: documents topic branch format, branch types (feature, bugfix, hotfix, release, docs, test, refactor), and step-by-step workflow for creating and linking branches via gh issue develop (check linked branch, infer type, short summary, create/checkout, keep in sync).

Integration tests

  • test_valid_branch_names_commit_succeeds: creates a valid branch (e.g. feature/123-test-branch), stages a file, runs pre-commit; expects success.
  • test_invalid_branch_names_commit_fails: uses invalid names (e.g. featur/123-typo, bugfix/missing-issue-number), runs pre-commit; expects failure and branch-related output.
  • Fix: bash command previously used the literal string {branch_name} instead of the Python variable; switched to f-strings so the actual branch name is passed and the branch-name hook is tested correctly.

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (README.md, CONTRIBUTE.md, etc.)
  • I have updated the CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

  • Branch protection, signed commits, and CI-based branch naming checks are out of scope for this PR and can be implemented globally from Enterprise account management.

- Exclude issue and template docs from .github_data
- Autofix shellcheck
- Autofix pymarkdown
- Add license compliance check
- Added pre-commit hook for enforcing branch naming convention
- Updated pre-commit configuration in the repository and workspace
- Included integration tests for branch name validation
- Documented cursor rules for branch naming and issue workflow
@c-vigo c-vigo requested a review from gerchowl January 30, 2026 15:30
@c-vigo c-vigo self-assigned this Jan 30, 2026
@c-vigo c-vigo added the feature New feature or request label Jan 30, 2026
@c-vigo c-vigo removed the request for review from gerchowl January 30, 2026 15:31
@c-vigo c-vigo merged commit 0b335ad into feature/37-automate-standardize-repository-setup Jan 30, 2026
1 check passed
@c-vigo c-vigo deleted the feature/38-standardize-branching-strategy-enforcement branch January 30, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant