For Conda users, Ruff is also available as ruff on conda-forge:
conda install -c conda-forge ruff
Usage
ruff check . # Lint all files in the current directory (and any subdirectories)
ruff check path/to/code/ # Lint all files in `/path/to/code` (and any subdirectories)
ruff check path/to/code/*.py # Lint all `.py` files in `/path/to/code`
ruff check path/to/code/to/file.py # Lint `file.py`
You can run Ruff in --watch mode to automatically re-run on-change: