Skip to main content

Validate Co-authored-by trailers in commit messages.

Project description

coauthorcheck logo

coauthorcheck

Lightweight command-line validation for Co-authored-by commit trailers.

CI PyPI version Supported Python versions License

Usage

coauthorcheck .git/COMMIT_EDITMSG
coauthorcheck HEAD
coauthorcheck HEAD~5..HEAD
coauthorcheck main..HEAD
coauthorcheck origin/main..HEAD

coauthorcheck --file .git/COMMIT_EDITMSG
coauthorcheck --commit HEAD
coauthorcheck --range HEAD~5..HEAD

Positional input is auto-detected in this order:

  • values containing .. or ... are treated as commit ranges
  • existing paths are treated as commit message files
  • everything else is treated as a commit ref

Use the explicit flags when you want fully unambiguous scripting.

Check the installed CLI:

coauthorcheck --help

Common Workflows

Validate the commit message currently being edited:

coauthorcheck .git/COMMIT_EDITMSG

Validate only the commits introduced by your current branch compared with main:

coauthorcheck main..HEAD

Validate only the commits introduced by your branch compared with the remote default branch:

coauthorcheck origin/main..HEAD

Validate the last few commits on the current branch:

coauthorcheck HEAD~3..HEAD

Configuration

coauthorcheck supports repository-local configuration from either:

  • pyproject.toml under [tool.coauthorcheck]
  • .coauthorcheck.toml

Configuration is resolved in this order:

  1. --config <path>
  2. nearest .coauthorcheck.toml
  3. nearest pyproject.toml with [tool.coauthorcheck]
  4. built-in defaults

When config files are auto-discovered, coauthorcheck searches upward from the current working directory. This means running the tool from a nested folder in the repo still finds the repo-level config.

Example using pyproject.toml:

[tool.coauthorcheck.rules]
single_word_name = false
github_handle = true
incorrect_casing = true
invalid_format = true
malformed_email = true
missing_email = true
missing_name = true

Example using .coauthorcheck.toml:

[rules]
single_word_name = false
github_handle = false
incorrect_casing = true
invalid_format = true
malformed_email = true
missing_email = true
missing_name = true

Use an explicit config file with:

coauthorcheck --config .coauthorcheck.toml main..HEAD

Unknown rule names or non-boolean values are treated as configuration errors.

See docs/rules.md for a detailed explanation of each rule. See docs/integrations.md for pre-commit and GitHub Actions examples. Use coauthorcheck --format json ... for machine-readable output in CI and automation.

Installation

Install from PyPI:

pip install coauthorcheck

Or with uv:

uv tool install coauthorcheck

Or with pipx:

pipx install coauthorcheck

After installation, run:

coauthorcheck --help

Local Development

For local development in this repo:

uv sync

Run from the project virtualenv:

uv run coauthorcheck --help

Run the tool from another repository by changing into that repository first and then invoking the executable from this project:

cd /path/to/other-repo
/path/to/coauthorcheck/.venv/Scripts/coauthorcheck.exe main..HEAD

In Git Bash, use /c/... style paths:

/path/to/coauthorcheck/.venv/Scripts/coauthorcheck.exe main..HEAD

Development

Run the test suite:

uv run pytest

Run the linter:

uv run ruff check .

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

coauthorcheck-0.2.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

coauthorcheck-0.2.1-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for coauthorcheck-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e71339fbba3e75b6311d43018f7742e3758643b6479ffba16d6099ec418cc399
MD5 9d7c079e780d112dbcf94bf1185a142f
BLAKE2b-256 947b9f317bc40d1de09df6b2f7b5aab08980006a68bb0b3924bb40d05a024d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for coauthorcheck-0.2.1.tar.gz:

Publisher: release.yml on simoncraf/coauthorcheck

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

File details

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

File metadata

  • Download URL: coauthorcheck-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for coauthorcheck-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9da5f9d17a13e1bec10701831ff7d6e4fb81fddd19a35db6df0b5bbc48b4f03c
MD5 0adc0e3fafd7900d2917401ffc4e8706
BLAKE2b-256 e89e480419b6cdbb0e4f23f36fb582b8fa3ccd9cdf97ca5c7deea3946d83aed8

See more details on using hashes here.

Provenance

The following attestation bundles were made for coauthorcheck-0.2.1-py3-none-any.whl:

Publisher: release.yml on simoncraf/coauthorcheck

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