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

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.11.2
File Size Uploaded Provenance Actions
gitfluff-0.11.2.tar.gz 6.7 kB With provenance Details for gitfluff-0.11.2.tar.gz

Built distribution (wheel)

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

Total release size: 12.9 kB

Release files / gitfluff-0.11.2.tar.gz

Download URL gitfluff-0.11.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d96d7bcc346046559a1bcda6e8af3f3fcd51ca1e76f4b8b353cb8c647adeb280
BLAKE2b-256 checksum
How to use checksums
fa5729309d4c17d9aabacf579d92e253a5eedb837f46e3f67d56d37cd272c259
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 9, 2026.

Transparency log

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

Download URL gitfluff-0.11.2-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
590f25279930d2e7a28966d96987d8688c2d5d088c7f4e4f7cf8679b077cdd79
BLAKE2b-256 checksum
How to use checksums
97be8e73741cbadebd3e2d68cefb0803c1966ea892b16ac41cc6204a8bf93126
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 9, 2026.

Transparency log

Security for gitfluff 0.11.2

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.11.2.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 9, 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