Ruff#
Ruff is a fast Python linter and code formatter. It enforces code style, catches common errors, and can automatically fix many issues. In this template, Ruff is run via pre-commit hooks and as a script:
hatch run lint
hatch run format
Configuration#
Ruff settings are in the [tool.ruff] section of pyproject.toml. Adjust rules, exclusions, and formatting options as needed.
Further Reading#
Hatch curates a handy baseline for ruff configuration, which you can find in the ruff_defaults.toml file.
Alternatives#
Other popular Python linters and formatters include: