Validate git branch names against Serokell conventions.
branch-lint is a Haskell library and CLI tool that checks whether a git branch name follows Serokell's branching conventions. Valid branch names take the form <github-username>/<issue-id>-<brief-description>.
Serokell uses a OneFlow variant where every branch is owned by a developer and tied to an issue:
alice/bl1-setup-repository
<github-username>: the branch owner's GitHub username<issue-id>: a YouTrack ID (e.g.bl5) or GitHub issue number (e.g.#42)<brief-description>: lowercase letters, digits, and dashes
branch-lint encodes these rules and can run as a pre-commit hook, a CI check, or a standalone CLI.
Build from source with Nix:
nix buildOr with Cabal:
cabal buildCheck a branch name:
branch-lint alice/bl1-setup-repositoryExit code 0 means the branch is valid. Any non-zero exit code means it is invalid; the error is printed to stderr.
Use as a pre-commit hook by adding to .git/hooks/pre-commit:
branch-lint "$(git rev-parse --abbrev-ref HEAD)"Please see CONTRIBUTING.md and docs/branching.md.
Issues are tracked on GitHub.
branch-lint is maintained and funded with ❤️ by Serokell.
The names and logo for Serokell are trademark of Serokell OÜ.
We love open source software! See our other projects or hire us to design, develop and grow your idea!