Member-only story
Ruff: a game changer for Python linters.
What is it ?
Ruff is a linter for Python designed to improve code quality and streamline development workflows. Written in Rust, it delivers significantly better performance compared to traditional linters, capable of analyzing entire projects in just seconds. Compatible with many of the rules from popular tools like Flake8, PyLint, and others, it stands out as a comprehensive and efficient solution for maintaining clean code standards and minimizing errors in Python projects.
Install & running
I have stopped using pip to manage dependencies (if it could actually manage them in any way) and now I use Poetry. If you want to learn more, here’s my introduction.
poetry add ruff
Now you’re ready to use Ruff in your project. However, I recommend configuring your file as follows as a starting point:
[tool.poetry]
name = "blabla"
version = "0.1.0"
description = ""
authors = ["Santiago.Gonzalez"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
sqlalchemy = "^2.0.36"
pandas = "^2.2.3"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3.3"
pytest-cov = "^6.0.0"
pytest-sugar = "^1.0.0"
pytest-mock = "^3.14.0"
pytest-xdist = "^3.6.1"
pytest-benchmark = "^5.1.0"
ruff = "^0.7.2"
pre-commit = "^4.0.1"
[build-system]
requires…