Skip to main content

Commit messages checking tool.

Project description

Build Status codecov PyPi version Python versions black-formatter wemake-python-styleguide License: MIT visitors

Dikort: git commit message format checking tool

The tool that helps you make commit message in your repository clear.

Key Features

  • Wide check list: author name, email, trailing periods, capitalize sentence, singleline summary, singoff, gpg, regex.
  • Checks any commit range: acceptable for both CI and pre-commit hook usage
  • Separate rules for both: merge and regular commits
  • Support all available python versions: 3.6+

Technical Requirements/Installation

Pre-requirements

Install any supported python distribution (for now it's 3.6+), and pip package management tool. Also make sure you have git installed

Examples:

Ubuntu/Debian

sudo apt install python3 python3-pip git

CentOS/RedHat/Fedora

sudo yum install python3 git

Installation

By default, pip tries to install package directly to you system. You may need to use sudo to achieve this

sudo pip3 install dikort

The more right way is to install to your home directory. But be sure you have $HOME/.local/bin at your $PATH variable

pip3 install --user dikort

Running and Configuring

Dikort is a command line tool. To see all available options with explanation hit dikort -h. The only one unnamed option is commit range in the notation of "<commit1>..<commit2>", where "commit1" and "commit2" are any of: hash, branch, tag, HEAD pointer.

Examples

Check last commit. Use this in git pre-commit hook

dikort HEAD~1..HEAD

Check last 10 commits

dikort HEAD~10..HEAD

Check all commits in fix-123 branch

dikort master..fix-123

Configure through command line

dikort --enable-length --enable-capitalized-summary --min-length=20 --max-length=72 HEAD~5..HEAD

Get log and save it (DEBUG mode)

dikort --enable-logging --logging-level=DEBUG 2>debug.log

Run in docker

Also you can run inside docker. Just mount your repository to container and tell dikort where to find.

docker run -v `pwd`:/tmp/repo weastur/dikort:latest --repository=/tmp/repo --enable-length

File configuration

Refer to config example, as a full configuration file. By default, config searched at ./.dikort.cfg

Development Status

Dikort is in active development and accepts contributions. See our Contributing section below for more details.

We report new releases information here.

How to contribute

Fork, clone, setup development environment. No third-party build or test tools need to be insttalled at your system.

python3 -m venv .venv
. ./.venv/bin/activate
pip install setuptools wheel
pip install -e '.[dev]'

After that you'll have dikort and all development tools installed into virtualenv. Just run here dikort to execute your development version. Hack, then make PR. Don't forget to write unit tests, and check your code:

dikort
flake8 dikort
isort dikort
black dikort
coverage run -m unittest discover
coverage report

Or you can just install git-hooks

Git hooks

ln -s -r -t ./.git/hooks/ ./hooks/*

License

MIT, see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dikort-0.2.1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

dikort-0.2.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file dikort-0.2.1.tar.gz.

File metadata

  • Download URL: dikort-0.2.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.13

File hashes

Hashes for dikort-0.2.1.tar.gz
Algorithm Hash digest
SHA256 daa4305ab6d037efa4a84aebd37b8f1e4520c3ae25e9af68e62ed3a0e7a1cf52
MD5 32711aef3f4e9db8c357ac6b12684cdf
BLAKE2b-256 02ecd7bbd4fb6ffb8b61d0758d9f1aa0d593b98b0b5e66b04600002df4bdfbeb

See more details on using hashes here.

File details

Details for the file dikort-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: dikort-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.13

File hashes

Hashes for dikort-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51ef882b2cc651f866926260c504182e5b88a662386295b0013347c3b5e0fdc2
MD5 36690e34d14a877a700b8ebf9943a754
BLAKE2b-256 ea99e586e1853bd9ab440e7367aaf285a93d153faccf9e689439d67ffdeb37b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page