Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pre-commit

Badness ships a pre-commit hook through the badness-pre-commit mirror repository. The hook installs the prebuilt badness wheel from PyPI, so no Rust toolchain is needed. Add this to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/jolars/badness-pre-commit
    # badness version
    rev: v0.9.0
    hooks:
      # Lint .tex, .sty, .cls, .dtx, .ins, and .bib files
      - id: badness-lint
      # Format the same files in place
      - id: badness-format

Tags mirror badness releases: rev: v0.9.0 runs badness 0.9.0.

To apply safe lint autofixes before formatting (the fix-then-format pipeline), pass --fix:

- id: badness-lint
  args: [--fix]
- id: badness-format

To check formatting without rewriting files:

- id: badness-format
  args: [--check]