Skip to main content

gitcommit
a tool for writing conventional commits, conveniently

PyPI version Travis CI build Code style: black

Install

To install

pip install conventional-commit

To use, run the following command from within a git repository

gitcommit

Overview

The purpose of this utility is to expedite the process of committing with a conventional message format in a user friendly way. This tool is not templated, because it sticks rigidly to the Conventional Commit standard, and thus not designed to be 'altered' on a case by case basis.

Commit messages produced follow the general template:

<type>[(optional scope)]: <description>

[BREAKING CHANGE: ][optional body / required if breaking change]

[optional footer]

Additional rules implemeted:

  1. Subject line (i.e. top) should be no more than 50 characters.
  2. Every other line should be no more than 72 characters.
  3. Wrapping is allowed in the body and footer, NOT in the subject.

Development

The old distribution method is documented in docs/dev_distibution_legacy.md

Note: if modifying .travis.yml you should verify it by running travis lint .travis.yml

Getting started

  1. Make sure you have pre-commit installed.

  2. Make sure you have pyenv installed.

  3. Make sure you have Poetry installed.

  4. git clone

  5. pre-commit install

  6. It is highly recommend you enable setting for storing the venvs within your projects.

    poetry config virtualenvs.in-project true
    
  7. Install project dependencies.

    poetry install
    

Running the package locally

  1. Activate the virtual environment.

    source .venv/bin/activate
    
  2. Run the package as a module.

    python -m gitcommit
    

Alternatively,

  1. Run the package using Poetry's venv as context
    poetry run python -m gitcommit
    

Or, if in another directory,

  1. ~/GitHub/gitcommit/.venv/bin/python -m gitcommit
    

Deploy

Deployment is handled automatically by Travis CI. It has been linked to the repository and is automatically watching for pushes to master. It will build and test every commit to master. It will also build every tagged commit as if it was a branch, and since its a tagged commit, will attempt to publish it to PyPI.

  1. Don't forget to increment version number set in pyproject.toml. This can be done with poetry.

    poetry version [patch|minor|major]
    
  2. Update the version number as stored in the gitcommit/__version__.py file to match that designated by Poetry.

  3. Tag the commit (by default applies to HEAD commit - make sure you are on the latest develop commit).

    git tag v#.#.#
    
  4. When pushing commits to remote, you must explicitly push tags too.

    git push origin --tags
    

Acknowledgements

This work takes inspiration from another repository porting Commitizen to Python. This repository however uses none of the same source code and is focusing on a different approach.

License

This work is published under GNU GPLv3.

Metadata

Release files for conventional-commit 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for conventional-commit 0.4.2
File Size Uploaded
conventional-commit-0.4.2.tar.gz 24.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for conventional-commit 0.4.2
File Interpreter ABI Platform
conventional_commit-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 50.1 kB

Release files / conventional-commit-0.4.2.tar.gz

Download URL conventional-commit-0.4.2.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f8e3840c075ebdfbaa0c46be33a1eef3b6e021de8fc4988cc348205a659e5d04
BLAKE2b-256 checksum
How to use checksums
7e1aa06de3bcb719ceeb39e664c05afbe59dd1d79a135679665abe6c0fa1000a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.7.1 Linux/4.15.0-1028-gcp

Release files / conventional_commit-0.4.2-py3-none-any.whl

Download URL conventional_commit-0.4.2-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4210e44a5608b686e8133e67e5b2bed86264334d06c6257d2019286304f5ac52
BLAKE2b-256 checksum
How to use checksums
c69b90c49c85ea11fb528cef653ea9742168e799f6a4f1dbad13f9eb3b7adac0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.9 CPython/3.7.1 Linux/4.15.0-1028-gcp

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page