- Python 100%
| .gitignore | ||
| committy.py | ||
| LICENSE | ||
| README.md | ||
| test_committy.py | ||
committy
A stupidly simple conventional-commit message builder. You give it flags,
it builds a properly formatted commit message and runs git commit for you
— no more fat-fingering colons, parens, or forgetting the ! on a breaking
change.
Why
Conventional Commits are great until
you're typing them out by hand for the hundredth time and forget where the
! goes. committy builds the string for you from flags, so the format is
never wrong.
Install
It's a single file — no pip, no virtualenv. Just symlink it onto your $PATH:
git clone https://git.turngear.dev/josh/committy.git
cd committy
chmod +x committy.py
ln -s "$(pwd)/committy.py" ~/.local/bin/committy
Make sure ~/.local/bin is actually on your $PATH (echo $PATH to check —
most modern Linux distros add it by default).
That's it. Use it from any repo like a normal command.
Usage
git add .
committy -t feat -s "new email system" -d "This replaces the old XYZ system, cleaner but not compatible" -b "This will NOT work with prev implementations of the email system..."
Builds the message:
feat(new email system)!: This replaces the old XYZ system, cleaner but not compatible # BREAKING CHANGE: This will NOT work with prev implementations of the email system...
...and runs:
git commit -m "feat(new email system)!: This replaces the old XYZ system, cleaner but not compatible # BREAKING CHANGE: This will NOT work with prev implementations of the email system..."
Available commit types:
COMMIT_TYPES = [
"ci",
"fix",
"docs",
"feat",
"perf",
"test",
"build",
"chore",
"style",
"revert",
"refactor",
]
Flags
| Flag | Long form | Required? | Description |
|---|---|---|---|
-t |
--type |
yes | Commit type — one of the above mentioned commit types |
-d |
--desc |
yes | The commit description |
-s |
--scope |
no | Scope — renders as type(scope): |
-b |
--breaking |
no | Marks the commit ! and appends a BREAKING CHANGE: footer |
-p |
--preview |
no | Dry run — prints the command instead of running it |
Preview before committing
Add -p if you want to see the message without actually committing:
committy -t feat -d "testing this out" -p
Format reference
<type>[(scope)][!]: <description> [# BREAKING CHANGE: <description>]
!and theBREAKING CHANGE:footer only ever show up together — both are controlled by-b.scopeis optional and shows up in parens right after the type.
License
MIT — see LICENSE.