fortitude-pre-commit

May 14, 2026 ยท View on GitHub

A pre-commit hook for Fortitude.

Distributed as a standalone repository to enable installing Fortitude via prebuilt wheels from PyPI.

Using Fortitude with pre-commit

To run Fortitude via pre-commit, add the following to your .pre-commit-config.yaml:

repos:
- repo: https://github.com/PlasmaFAIR/fortitude-pre-commit
  # Fortitude version.
  rev: v0.9.0
  hooks:
    - id: fortitude

Extra arguments may be provided to the lint hook:

repos:
- repo: https://github.com/PlasmaFAIR/fortitude-pre-commit
  # Fortitude version.
  rev: v0.9.0
  hooks:
    - id: fortitude
      args: ["--fix", "--unsafe-fixes", "--preview"]

When running with --fix, Fortitude's lint hook should be placed before any code formatters in use.

Note that Fortitude will run with the option --force-exclude switched on by default. This will prevent Fortitude from checking files that have been explicitly added to your exclude list in fpm.toml or fortitude.toml.

License

This repository in based on ruff-pre-commit, which is licensed under either of:

It is additionally licensed under the MIT license for the PlasmaFAIR project.