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.9.1
    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.9.1

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.9.1
File Size Uploaded Provenance Actions
gitfluff-0.9.1.tar.gz 6.6 kB With provenance Details for gitfluff-0.9.1.tar.gz

Built distribution (wheel)

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

Total release size: 12.8 kB

Release files / gitfluff-0.9.1.tar.gz

Download URL gitfluff-0.9.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
49e9853f64f4c66c54508b1406b5952431a0f7f3646d406234919a4134ecb351
BLAKE2b-256 checksum
How to use checksums
d384a63b66e70b881a50487819feeec8d727754fc7f6bbe94fae76696876f8fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

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

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

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 Oct 15, 2026.

Transparency log

Security for gitfluff 0.9.1

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.9.1.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 Oct 15, 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