Python Format and Lint
Ruff + Black-style formatting for a clean, consistent codebase.
- ruff
- python lint
- mypy
- format python
- flake8
Python Format and Lint
Ruff + Black-style formatting for a clean, consistent codebase.
Commands
| Command | What it does |
|---|---|
ruff check . | Lint the project |
ruff check --fix . | Auto-fix what is safe |
ruff format . | Black-compatible formatting |
mypy src/ | Static type checking |
python -m compileall -q . | Syntax sanity sweep |
Example
ruff check --fix .
ruff format .
mypy src/
FAQ
Ruff vs flake8+black+isort?
Ruff replaces all three in one fast binary with compatible rules and formatting.
Which rules to enable first?
Pyflakes (F), pycodestyle (E), isort (I), pyupgrade — then bugbear (B) as the team matures.
Întrebări frecvente
Ruff vs flake8+black+isort?
Ruff replaces all three in one fast binary with compatible rules and formatting.
Which rules to enable first?
Pyflakes (F), pycodestyle (E), isort (I), pyupgrade — then bugbear (B) as the team matures.
Python
Python Venv and Environments
Isolate dependencies per project with venv and pinned requirements.
Python Pip Essentials
Install, upgrade, and audit packages with pip like a pro.
Python Basics
Syntax survival kit: variables, loops, f-strings, and errors.
Python Strings
Slice, split, join, and format text efficiently.