Skip to content

Repository files navigation

branch-lint

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>.

Table of Contents

Background

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.

Install

Build from source with Nix:

nix build

Or with Cabal:

cabal build

Usage

Check a branch name:

branch-lint alice/bl1-setup-repository

Exit 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)"

For Contributors

Please see CONTRIBUTING.md and docs/branching.md.

Issues are tracked on GitHub.

License

MPL-2.0 © Serokell

About Serokell

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!

About

Validate git branch names against Serokell conventions

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

Generated from serokell/metatemplates