Ruff is widely considered the best modern Python linter due to its extreme speed, ability to replace multiple tools (like Flake8, isort, and Black), and comprehensive rule set. While Pylint remains the standard for the most thorough static analysis and bug detection, it is significantly slower and often used in conjunction with Ruff for critical checks.
For type checking, Pyright (used in VS Code via Pylance) and MyPy are the leading tools, with Pyright generally offering faster feedback and better integration with modern editors.
Comparison of Top Tools
| Tool | Primary Strength | Language | Best For |
| Ruff | Speed & Feature Completeness | Rust | Replacing Flake8, isort, and Black; large codebases |
| Pylint | Depth of Analysis | Python | Finding subtle bugs and enforcing strict coding standards |
| Pyright | Type Checking | TypeScript | Real-time type checking and IDE integration |
| Black | Formatting | Python | Enforcing a consistent code style (often paired with Ruff) |
| MyPy | Type Inference | Python | Static type checking in large, complex projects |
Key Considerations
Performance: Ruff is 100 times faster than traditional Python-based linters like Pylint, making it ideal for CI/CD pipelines and real-time editor feedback.
Compliance: Ruff supports over 500 rules and is compatible with
pyproject.tomlfor configuration.Workflow: Many developers now use a combination of Ruff (for linting and formatting) and Pyright/MyPy (for type checking) to cover all quality assurance needs efficiently.
command line - Python linter and code formatter recommendations - Software Recommendations Stack Exchange
Python Lints Suggestions
visual studio code - Real-time linting of Python with VSCode - Stack Overflow
Python linter and tests - Developers - Klipper
Videos
I use black & isort for code formatting and flake8 for style checking and linting. Pylint is a great addition too, it's stricter and provides detailed feedback - great for improved code quality over time.
Ruff is a modern Python linter and formatter.
Its main highlight is the speed, which claims to be up to 100x faster than the other alternatives.
Ruff ships with a built-in language server, that enables it to be used in any editor that supports the LSP (Neovim, Emcas, Sublime, etc).
There is also a dedicated VS Code extension.
Also it has a pre-commit hook from the authors: https://github.com/astral-sh/ruff-pre-commit
EDIT4, 14 Apr 2024
Enable format on save option in UI setting globally.
EDIT3, 13 Apr 2024 Its just enough for 1.88.1 version
{
"editor.formatOnSave": true
}
EDIT2, 27 Mar 2024
Just only use this config to real time linting.
{
"python.defaultInterpreterPath": "/usr/bin/python3",
"editor.formatOnSave": true
}
Installed extensions are
- python
- pylint
- pylance
- python debugger
- autopep8
EDIT1
Update 4 Jul 2022
New version of python extension deprecates "python.pythonPath" and suggest to use this instead.
"python.defaultInterpreterPath": "/usr/bin/python3",
Put these lines in .vscode/settings.json
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.pythonPath": "/usr/bin/python3",
"editor.formatOnSave": true
}
And install autopep8 package.
Use pip to install it
python3 -m pip install autopep8
Or in Debian based as python3-autopep8 exists in repo you can run
sudo apt install python3-autopep8
And then python linting on vscode will work.
Also, the Warning menu will activate.
Hint that I set run linter onsave.

If you use shift + cmd + P (or ^+ctrl+P for windows) or go to View > Command Palette and type "Lint"
The Command Palette allows you to execute different commands, from here you can enable/disable Linting and select which Linter you would like to use. Most popular is PyLint but you can select Flake8 or Pep8 or whatever you like.
I believe you need to do these things before the linter works in real-time.
To scan for problems with your code without saving first, use shift + cmd + M, you will receive an error code in the vscode Terminal.