Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Ruff (also from Astral) replaced the entire linter stack — pyflakes, pycodestyle, pylint, isort, even Black for formatting. It's 10–100× faster and reads its config from pyproject.toml. Mypy adds type checking on top. The 2026 baseline: ruff check + ruff format + mypy --strict in CI, with project-specific allows in pyproject.toml. A team that adopts both from day 1 has clean code forever; a team that doesn't will fight 10 paper cuts a week.
Ruff is a Rust-based linter and formatter that replaces pyflakes, pycodestyle, isort, pyupgrade, and Black in a single binary, running 10-100× faster than any of them individually. It reads all configuration from [tool.ruff] in pyproject.toml, which means one file governs both linting rules and formatting style for your entire team. Layering mypy on top adds static type checking — when both run in a pre-commit hook or CI step, the feedback loop from 'I wrote a bug' to 'the tool caught it' shrinks to under a second.
[tool.ruff] section to a real project. Run ruff check . and fix every finding (most are auto-fixable with ruff check --fix).ruff format . on a Python file with mixed quoting / spacing. It rewrites it to one canonical style.[tool.mypy] with strict = true. Run mypy src/. Expect findings — strict mode is uncompromising on first use.# pyproject.toml
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "B", "UP", "N", "RUF"]
# E/F = pycodestyle/pyflakes; I = isort; B = bugbear; UP = pyupgrade; N = pep8 names; RUF = ruff-specific
[tool.mypy]
python_version = "3.12"
strict = true
warn_unused_ignores = true
# typical lifecycle:
$ ruff check . # lint
$ ruff format . # format (replaces black)
$ mypy src/ # type check
# pre-commit hook (.git/hooks/pre-commit):
#!/bin/sh
ruff check . && ruff format --check . && mypy src/python3 main.py