Step 6 Formatting and linting with ruff
ruff is one tool that replaces 5: flake8, black, isort, pyupgrade, and pylint. Written in Rust, it runs 10x to 100x
faster than the legacy tools. Default config matches PEP 8 out of the box, which is
exactly what most professors grade against.
Minimal ruff.toml at the project root
# ruff.toml
line-length = 100
target-version = "py312"
[lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"UP", # pyupgrade
"SIM", # flake8-simplify
]
ignore = [
"E501", # line-too-long handled by formatter
]
[format]
quote-style = "double"
indent-style = "space"
target-version = "py312" tells ruff which interpreter to lint
against. Set it to "py310" or "py311" if your course pins an older interpreter. Skip the ruff.toml entirely and the defaults still work fine; the file is for the moment a professor says 120-character lines and you need to widen line-length.