gitfluff


Namegitfluff JSON
Version 0.3.3 PyPI version JSON
download
home_pageNone
SummaryCommit message linter and formatter
upload_time2025-10-20 05:39:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords git commit lint conventional format
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # gitfluff

Commit message linter with presets, custom formats, and cleanup automation. Fully compliant with [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/).

This Python package distributes prebuilt `gitfluff` binaries. On first use, the correct release binary for your platform is downloaded and cached under `~/.cache/gitfluff`.

## Quick Start

**Install with pip:**
```bash
pip install gitfluff
```

**Run without installation (uvx):**
```bash
uvx gitfluff --version
```

**Lint a commit message:**
```bash
gitfluff lint .git/COMMIT_EDITMSG
```

**Auto-clean and rewrite:**
```bash
gitfluff lint .git/COMMIT_EDITMSG --write
```

## Hook Integrations

### Native Git Hook

**Install commit-msg hook:**
```bash
gitfluff hook install commit-msg
```

**With auto-cleanup:**
```bash
gitfluff hook install commit-msg --write
```

### pre-commit Framework

**Add to `.pre-commit-config.yaml`:**
```yaml
default_install_hook_types:
  - pre-commit
  - commit-msg

repos:
  - repo: https://github.com/Goldziher/gitfluff
    rev: v0.3.3
    hooks:
      - id: gitfluff-lint
        stages: [commit-msg]
```

**Install the hooks:**
```bash
pre-commit install
```

### Lefthook (uvx)

**Add to `lefthook.yml`:**
```yaml
commit-msg:
  commands:
    gitfluff:
      run: uvx gitfluff lint {1}
```

**Install hooks:**
```bash
npx lefthook install
```

## Optional configuration

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

```toml
preset = "conventional-body"  # optional preset override

[rules]
write = true
```

Any setting can be left out; omit the file entirely to keep defaults.

## Advanced usage

- Override rules per-invocation using CLI flags (e.g. `--preset`, `--exclude`, `--cleanup`, `--single-line`).
- 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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "gitfluff",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "git, commit, lint, conventional, format",
    "author": null,
    "author_email": "Na'aman Hirschfeld <nhirschfeld@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/64/18/c9f031642e835d31135401afabf0ed8a60834eea77bb9f43a5893ad86247/gitfluff-0.3.3.tar.gz",
    "platform": null,
    "description": "# gitfluff\n\nCommit message linter with presets, custom formats, and cleanup automation. Fully compliant with [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/).\n\nThis Python package distributes prebuilt `gitfluff` binaries. On first use, the correct release binary for your platform is downloaded and cached under `~/.cache/gitfluff`.\n\n## Quick Start\n\n**Install with pip:**\n```bash\npip install gitfluff\n```\n\n**Run without installation (uvx):**\n```bash\nuvx gitfluff --version\n```\n\n**Lint a commit message:**\n```bash\ngitfluff lint .git/COMMIT_EDITMSG\n```\n\n**Auto-clean and rewrite:**\n```bash\ngitfluff lint .git/COMMIT_EDITMSG --write\n```\n\n## Hook Integrations\n\n### Native Git Hook\n\n**Install commit-msg hook:**\n```bash\ngitfluff hook install commit-msg\n```\n\n**With auto-cleanup:**\n```bash\ngitfluff hook install commit-msg --write\n```\n\n### pre-commit Framework\n\n**Add to `.pre-commit-config.yaml`:**\n```yaml\ndefault_install_hook_types:\n  - pre-commit\n  - commit-msg\n\nrepos:\n  - repo: https://github.com/Goldziher/gitfluff\n    rev: v0.3.3\n    hooks:\n      - id: gitfluff-lint\n        stages: [commit-msg]\n```\n\n**Install the hooks:**\n```bash\npre-commit install\n```\n\n### Lefthook (uvx)\n\n**Add to `lefthook.yml`:**\n```yaml\ncommit-msg:\n  commands:\n    gitfluff:\n      run: uvx gitfluff lint {1}\n```\n\n**Install hooks:**\n```bash\nnpx lefthook install\n```\n\n## Optional configuration\n\nNo configuration is required\u2014the default Conventional Commits rules apply immediately. If you want project overrides, create `.gitfluff.toml`:\n\n```toml\npreset = \"conventional-body\"  # optional preset override\n\n[rules]\nwrite = true\n```\n\nAny setting can be left out; omit the file entirely to keep defaults.\n\n## Advanced usage\n\n- Override rules per-invocation using CLI flags (e.g. `--preset`, `--exclude`, `--cleanup`, `--single-line`).\n- Set `GITFLUFF_BINARY` to point at a custom build when testing unpublished versions.\n- Clear the cache (`rm ~/.cache/gitfluff/gitfluff*`) to force a fresh download.\n\n## License\n\nMIT \u00a9 Na'aman Hirschfeld and contributors\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Commit message linter and formatter",
    "version": "0.3.3",
    "project_urls": {
        "Homepage": "https://github.com/Goldziher/gitfluff",
        "Issues": "https://github.com/Goldziher/gitfluff/issues",
        "Repository": "https://github.com/Goldziher/gitfluff.git"
    },
    "split_keywords": [
        "git",
        " commit",
        " lint",
        " conventional",
        " format"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8df74a808132e4a9ab024ccb089be2ac5d39691ec8eac4184b66ab09b8295272",
                "md5": "157bf821bf8cea8c20a274c0a732dec5",
                "sha256": "030c3dc4f55783808866b20df2b57d7b311a3cc601039707b552eba66e01a4be"
            },
            "downloads": -1,
            "filename": "gitfluff-0.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "157bf821bf8cea8c20a274c0a732dec5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4928,
            "upload_time": "2025-10-20T05:39:06",
            "upload_time_iso_8601": "2025-10-20T05:39:06.953606Z",
            "url": "https://files.pythonhosted.org/packages/8d/f7/4a808132e4a9ab024ccb089be2ac5d39691ec8eac4184b66ab09b8295272/gitfluff-0.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6418c9f031642e835d31135401afabf0ed8a60834eea77bb9f43a5893ad86247",
                "md5": "73fbd757ef170cefc8a89bf80d3cd633",
                "sha256": "39658a59c64e87ea84735801044e4ed7b1f1680d17a218723ef8172b0cb036f4"
            },
            "downloads": -1,
            "filename": "gitfluff-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "73fbd757ef170cefc8a89bf80d3cd633",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4258,
            "upload_time": "2025-10-20T05:39:07",
            "upload_time_iso_8601": "2025-10-20T05:39:07.712576Z",
            "url": "https://files.pythonhosted.org/packages/64/18/c9f031642e835d31135401afabf0ed8a60834eea77bb9f43a5893ad86247/gitfluff-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-20 05:39:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Goldziher",
    "github_project": "gitfluff",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gitfluff"
}
        
Elapsed time: 1.00913s