Skip to main content

validate commit messages and metadata

Project description

Validate Commits

Validate commit messages and metadata.

Usage

$ validate-commits --help
usage: validate-commits [-h]

options:
  -h, --help  show this help message and exit

The tool will check all commits between main and the current HEAD.

Checks

Built-in rules

There are several built-in rules, which are checked automatically:

  • "Commit author has no email" -- all commits must have an author email and all co-authors (in Co-authored-by trailers) must have an email.
  • "Commit is empty" -- empty commits are not allowed.
  • "Fixup commit" -- 'fixup' commits should be squashed into the commit they fix up.

Custom rules

Custom rules may be provided in a validate-commits-config.toml file. Rules must be provided as a regular expression pattern and an error message and will be checked against the designated target.

Commit summary

Checks for the commit summary (the first line of the commit message) may be defined in a [[checks.summary]] table, e.g:

[[checks.summary]]
pattern = '\d'
message = "Numbers in commit summary."

Author email

Checks for author and co-author email addresses may be defined in a [[checks.author_email]] table, e.g:

[[checks.author_email]]
pattern = '@example\.(com|net|org)$'
message = "Fake email address provided."

Project details


Download files

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

Source Distribution

validate_commits-0.0.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

validate_commits-0.0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file validate_commits-0.0.2.tar.gz.

File metadata

  • Download URL: validate_commits-0.0.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for validate_commits-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5b6e4ef87037c40951ed9038b9e6c0a465ca1465e20594b7518e79e10e21b605
MD5 ecd01d9c1056356d67a3f8f44e47a241
BLAKE2b-256 54820cf127159e825cf6fa869bcb6fae94250e4860e077919a998d31ad325ed9

See more details on using hashes here.

Provenance

The following attestation bundles were made for validate_commits-0.0.2.tar.gz:

Publisher: build_and_publish.yaml on samueljsb/validate-commits

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file validate_commits-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for validate_commits-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 589ef275913ca6a6f71e024db430e3d513e1a2e61d3235a389dd6a3ff652b9c1
MD5 1e776e7745c60b6de8f1dc36842d1cbc
BLAKE2b-256 5f1598e4ed0d029c8e7c0c0b735d82821e1ef1954067443d0b9b69c43654c55d

See more details on using hashes here.

Provenance

The following attestation bundles were made for validate_commits-0.0.2-py3-none-any.whl:

Publisher: build_and_publish.yaml on samueljsb/validate-commits

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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