Skip to content

python/ruff-format

Checks the layout of every Python file against the Ruff formatter.

Part of the python configuration, at the recommended level. It runs at the commit stage, per file. It runs ruff. gspot check --fix fixes what it can.

One layout everywhere keeps a diff about the change.

Run gspot check --fix.

value=1 differs from the Ruff output. Run gspot check --fix to get value = 1.

Turn it off for some files, or one of its lint rules, with a reason:

gspot ignore python/ruff-format --paths "<glob>" --reason "<why>"
gspot ignore python/ruff-format --rule <rule> --reason "<why>"

To silence one place, write a comment such as:

import plugins # noqa: F401 # the module registers its plugins on import