Skip to main content

gitfluff

Commit message linter with presets, custom formats, and cleanup automation. Fully compliant with Conventional Commits 1.0.0. Skips linting the repository’s COMMIT_EDITMSG while Git is creating a merge commit.

This Python package distributes prebuilt gitfluff binaries. On first use, the correct release binary for your platform is downloaded and cached under ~/.cache/gitfluff. The binary's SHA-256 checksum is verified against the release's published checksums manifest before extraction.

Quick Start

Install with uv:

uv tool install gitfluff

Run without installation (uvx):

uvx gitfluff --version

Lint a commit message:

gitfluff lint .git/COMMIT_EDITMSG

Auto-clean and rewrite:

gitfluff lint .git/COMMIT_EDITMSG --write

Add a .gitfluff.toml to enable automatic cleanup and stop the commit if a rewrite happened:

preset = "conventional"
write = true

[rules]
exit_nonzero_on_rewrite = true

Hook Integrations

Native Git Hook

Install commit-msg hook:

gitfluff hook install commit-msg

With auto-cleanup:

gitfluff hook install commit-msg --write

Hook installation respects core.hooksPath (including relative paths) and works correctly in linked git worktrees.

pre-commit Framework

Add to .pre-commit-config.yaml:

default_install_hook_types:
  - pre-commit
  - commit-msg

repos:
  - repo: https://github.com/Goldziher/gitfluff
    rev: v0.10.0
    hooks:
      - id: gitfluff-lint
        stages: [commit-msg]
        # args: ["--write"]  # optional, or set `write = true` in .gitfluff.toml
        # args: ["--msg-pattern", "^JIRA-[0-9]+: .+"]  # optional regex override

Install the hooks:

pre-commit install

Lefthook (uvx)

Add to lefthook.yml:

commit-msg:
  commands:
    gitfluff:
      run: uvx gitfluff lint {1}

Install hooks:

pnpm dlx lefthook install

Optional configuration

No configuration is required—the default Conventional Commits rules apply immediately. If you want project overrides, create .gitfluff.toml:

preset = "conventional-body"  # optional preset override
write = true

[rules]
no_emojis = true
ai_cleanup = true  # set to false to disable AI attribution cleanup
title_suffix = "\\(JIRA-[0-9]+\\)"
exit_nonzero_on_rewrite = true

Any setting can be left out; omit the file entirely to keep defaults. Unknown config keys now trigger an error rather than being silently ignored.

Advanced usage

  • Override rules per-invocation using CLI flags (e.g. --preset, --msg-pattern, --cleanup-pattern, --exclude, --cleanup, --single-line, --no-emojis, --ascii-only, --title-prefix, --title-suffix, --no-ai-cleanup).
  • Set GITFLUFF_BINARY to point at a custom build when testing unpublished versions.
  • Clear the cache (rm ~/.cache/gitfluff/gitfluff*) to force a fresh download.

License

MIT © Na'aman Hirschfeld and contributors

Metadata

Release files for gitfluff 0.10.0

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

Source distribution (sdist)

Source distribution for gitfluff 0.10.0
File Size Uploaded Provenance Actions
gitfluff-0.10.0.tar.gz 6.7 kB With provenance Details for gitfluff-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gitfluff 0.10.0
File Interpreter ABI Platform Actions
gitfluff-0.10.0-py3-none-any.whl Python 3 none any Details for gitfluff-0.10.0-py3-none-any.whl

Total release size: 12.9 kB

Release files / gitfluff-0.10.0.tar.gz

Download URL gitfluff-0.10.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9a5581d1196658d39eb8bbdbe56cf86596be11e87b70c0eb75c15c2b735307ae
BLAKE2b-256 checksum
How to use checksums
042ec0ebe02fcd2a8646cd4a4000ccf43eb27345c067115dfaaf941563857acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / gitfluff-0.10.0-py3-none-any.whl

Download URL gitfluff-0.10.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
976d25205497d70736fb92bf3ce399bc6da9c1a5e2f367f75d90de4e6d878d2f
BLAKE2b-256 checksum
How to use checksums
730d50b6916cb818790649dfe2a7a1d32963d2788562878e9a82f232e6aac4b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for gitfluff 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gitfluff-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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