Skip to content

Quality Tools

The template sets up a comprehensive code quality pipeline that runs automatically via pre-commit hooks and can be invoked manually.

Ruff

Ruff handles both formatting and linting in a single, fast tool.

# Auto-format code
make format

# Check formatting and lint rules
make check-quality
# Auto-format code
mise run format

# Check formatting and lint rules
mise run check:quality

Ruff is configured in pyproject.toml with sensible defaults. It replaces Black, isort, flake8, and many other tools.

Mypy

Mypy performs static type checking.

make check-types
mise run check:types

Configuration lives in pyproject.toml. If you enable the with_strict_typing option during generation, a py.typed marker file is included for PEP 561 compliance.

Pre-commit Hooks

pre-commit runs checks automatically before each commit. Hooks are configured in .pre-commit-config.yaml and include:

  • Ruff formatting and linting
  • Trailing whitespace removal
  • YAML/TOML validation
  • Merge conflict detection
  • Conventional commit message validation (if enabled)
# Run all hooks on all files manually
pre-commit run -a

# Install hooks (done automatically by make setup-dev)
pre-commit install

Running All Checks

# Run everything: lint, types, docs build
make check-all
# Run everything: lint, types, docs build
mise run check:all