Table of contents
- Key Features
- Development info
- Comparison to Other Tools
Have you ever wanted a tool that could ...
- predict the conventional commit label for commit message
- predict whether or not a commit is likely to break the build?
- let you know when your commit message does not follow a standard?
- tell you whether or not a commit message has the correct label?
- suggest a commit message/label if you are not sure how to write one?
CommitCanvas already has a feature that helps users identify and fix commit messages that do not conform to the following standards:
- Separate subject from body with a blank line
- Do not end the subject line with a period
- Capitalize the subject line and each paragraph
- Use the imperative mood in the subject line
- Wrap subject line at 72 characters
- automatically attach the conventional commit label to the commit message
Other features mentioned above are under development and will be added to CommitCanvas in the near future. Please see the issues for more information.
commitcanvas works with
pre-commit so please follow the steps below.
.pre-commit-config.yaml to your repository.
Add following code block inside the
minimum_pre_commit_version: 1.21.0 repos: # check with commitcanvas. - repo: https://github.com/CommittedTeam/CommitCanvas rev: the revision or tag to clone at hooks: - id: commitcanvas language_version: python3.7 language: python stages: [prepare-commit-msg]
pre-commit, please refer the documentation
commitcanvas as a
prepare-commit-msg hook, install pre-commit in
pre-commit install --hook-type prepare-commit-msg
NOTE: You need to run this command everytime you clone the repository, unless you configure
pre-commit globaly. Please follow the link for more information.
Every time you make a commit
commitcanvas will automatically check the commit message, and if there are any erros,
git commit command will be aborted before creating a commit, and helpul tips will be dispalyed about how to improve the commit message.
If you would like to skip commitcanvas errors, please run
git commit with
SKIP=commitcanvas. Please see
pre-commit documentation for more information about
Commitcanvas will also predict and attach the conventional commit label automatically. If you would like
to edit the message as well as the predicted label please run
git commit command with
Unless project-specific path is provided commitcnavas will use the pre-deployed model as a default
Commitcnavas can also be used in project specific mode. In this mode commitcnavas can be trained on selected repository.
For instance if you would like to train commitcnavas on your repository you need to provide git url and the local path to save the trained model.
Command to train and save the model:
commitcanvas train <url> <save>
After the model is saved please add the path to
pre-commit-config.yaml file in your repository
Please see Commitcanvas-models for more information about the deployed models
Clone the source code onto your machine
or With SSH:
Install Poetry (Recommended)
Poetry is a tool for dependency managment and packaging in Python. Please follow the documentation here on how to install poetry on your machine
When under developmnet always install the dependencies with
poetry install and run the program with
poetry run python program_name.
poetry update for updating the dependencies to their latest versions as neccessary. Please refer to documentation here for more information.
pre-commit hooks for linting the code. Install pre-commit with
pip install pre-commit or follow the documentation here. After cloning the repository locally run
pre-commit install to install pre-commit into your git hooks.
NOTE: You would have to run
pre-commit install every time you clone a repository. Please refer to documentation here for more information.
NOTE: You will not be able to complete commit unless all the linters pass. Only staged changes will be checked at the time of commit.
Developers of this program can run the test suite with
poetry run pytest
pre-commit install to install pre-commit in
poetry run pre-commit run --all-files to check the code with linters and get the diagnostic info.
Currently this project uses following linters:
You may add more linters to
Comparison to Other Tools
Some of the existing tools that are similar to CommitCanvas:
- gitlint: "Linting for your git commit messages"
- commitlint: "Lint commit messages"
- cz-cli: "The commitizen command line utility."
Popular existing tools for checking the commit message usually have features to lint the message, fix or suggest labels, add or modify the checks and help the users keep creating explicit commit history. In addition to those functionalities, in the near future, CommitCanvas will also have a feature to predict the build status and let the users see if the commit is going to break the build before pushing their changes to Github. Please see the issues for more information.
We welcome everyone who is interested in helping improve CommitCanvas! If you are interested in being a contributor, please review our Code of Conduct and Guidelines for Contributors before raising an issue, or beginning a contribution.
Gregory M. Kapfhammer