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

ToolPrimary StrengthLanguageBest For
RuffSpeed & Feature CompletenessRustReplacing Flake8, isort, and Black; large codebases
PylintDepth of AnalysisPythonFinding subtle bugs and enforcing strict coding standards
PyrightType CheckingTypeScriptReal-time type checking and IDE integration
BlackFormattingPythonEnforcing a consistent code style (often paired with Ruff)
MyPyType InferencePythonStatic 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.toml for 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.

🌐
Reddit
reddit.com › r/python › what is the best python linter in vscode?
r/Python on Reddit: What is the best Python linter in VSCode?
January 6, 2023 - I love pylint, chose it a long time ago as it seemed to find the most bugs (I am most worried about static code analysis in my linter, less worried about formatting) and have stuck with it since. ... Ruff. Easiest change i ever made. ... I think this thread/write up summarize it well. https://www.reddit.com/r/Python/comments/yzhykq/python_linter_comparison_2022_pylint_vs_pyflakes/?utm_source=share&utm_medium=ios_app&utm_name=iossmf
🌐
CodiLime
codilime.com › blog › software development › backend › best practices for python code quality — linters | codilime
Best practices for Python code quality — linters | CodiLime
Linters, such as Pylint, Flake8, MyPy, and Pyright, offer developers valuable insights and guidance, helping them identify areas for improvement and ensure their code aligns with established best practices.
Discussions

command line - Python linter and code formatter recommendations - Software Recommendations Stack Exchange
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I am looking for Python linter and code formatter recommendations. More on softwarerecs.stackexchange.com
🌐 softwarerecs.stackexchange.com
Python Lints Suggestions
Can you give me a lint that you use that you think would be useful for me to make my code more Pythonic? You know, I mostly use LLMs because I like my code to be perfect (correction: imperfect). I like structure, following guidelines or checking a box to know I’m doing it right, and so I ... More on discuss.python.org
🌐 discuss.python.org
0
0
June 24, 2023
visual studio code - Real-time linting of Python with VSCode - Stack Overflow
Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... Recently I'm using VSCode as my Python IDE, and I install DonJayamanne/pythonVSCode, which supports linting. However, the linter only works when saving, but what I want is real-time linting. More on stackoverflow.com
🌐 stackoverflow.com
Python linter and tests - Developers - Klipper
Hello. Have you thought about using linter and tests for python? For example flake8 and pytest. Right now some modules of the project are very hard to read, ran flake8 to look and got hundreds of errors. The more the project grows, the harder it will be to implement linter and tests. More on klipper.discourse.group
🌐 klipper.discourse.group
0
April 15, 2024
🌐
GitHub
github.com › vintasoftware › python-linters-and-code-analysis
GitHub - vintasoftware/python-linters-and-code-analysis: Python Linters and Code Analysis tools curated list · GitHub
pylint - Most intelligent Python linter. It's able to infer a lot using only static analysis, thereby finding subtle bugs.
Starred by 532 users
Forked by 22 users
🌐
DZone
dzone.com › coding › tools › linting excellence: how black, isort, and ruff elevate python code quality
Linting: Black, isort, and Ruff to Elevate Python
July 4, 2024 - Black, Ruff, and isort are powerful tools that help maintain high code quality in Python projects. Each tool has its specific strengths, making them suitable for different aspects of code quality: Black: Best for automatic code formatting and ...
🌐
Invent with Python
inventwithpython.com › blog › comparing-python-linters-2022.html
Python Linter Comparison 2022: Pylint vs Pyflakes vs Flake8 vs autopep8 vs Bandit vs Prospector vs Pylama vs Pyroma vs Black vs Mypy vs Radon vs mccabe - Invent with Python
November 19, 2022 - After personally reviewing all of them, I've selected the following as must-haves: Pyflakes, Mypy, and Black. If you'd like additional tools, I also liked: Radon, Pyroma, and docformatter.
🌐
Wolf Paulus' Journal
wolfpaulus.com › lint
Linting Python Code in VSCode
The Ruff extension for Visual Studio Code is based on ruff, a fast linter and code formatter built in Rust. It supports Python 3.7+ and integrates seamlessly with VS Code for linting and formatting.
Find elsewhere
🌐
Geekflare
geekflare.com › development › 10 python linter platforms to clean up your code
10 Python Linter Platforms to Clean Up Your Code
January 20, 2025 - Considering those and many other aspects, here is a list of the best tools. Ruff is a Python linter made by Astral. It is free and open source. Ruff is written in Rust and is, therefore, incredibly fast compared to other linters.
🌐
Visual Studio Code
code.visualstudio.com › docs › python › linting
Linting Python in Visual Studio Code
November 3, 2021 - Note: Syntax error detection is enabled by default in the Python extension's Language Server. To learn how you can configure the Language Server, see Language Server Settings. This document covers how you can enable linting for additional code detection, including stylistic checks. Search the VS Code Marketplace for the linter ...
🌐
Python.org
discuss.python.org › python help
Python Lints Suggestions - Python Help - Discussions on Python.org
June 24, 2023 - Can you give me a lint that you use that you think would be useful for me to make my code more Pythonic? You know, I mostly use LLMs because I like my code to be perfect (correction: imperfect). I like structure, following guidelines or checking a box to know I’m doing it right, and so I ...
🌐
Dsstream
dsstream.com › post › improve-your-python-code-quality---a-python-linters-overview
Improve your python code quality – a python linters overview | DS Stream Data Science
Python linters like Pylint, Flake8, and PyFlakes act as 'highway code' for your scripts—catching errors and enforcing style. This breakdown compares their strengths: Pylint for depth, Flake8 for balance, PyFlakes for simplicity.
🌐
Readthedocs
py-vscode.readthedocs.io › en › latest › files › linting.html
Linting & Formatting 🎀 — How to Python in VS Code 🦄 documentation
It’s one of the better linters out there that has very low false positive rate. It checks your code base against PEP8 programming style, programming errors (like “library imported but unused” and “Undefined name”) and cyclomatic complexity. For more details on the nitty gritties of flake8, check out their github project here. Black is known as the uncompromised Python code formatter.
🌐
Astral
docs.astral.sh › ruff
Ruff
An extremely fast Python linter and code formatter, written in Rust.
🌐
Quora
quora.com › What-is-the-best-linter-for-Python
What is the best linter for Python? - Quora
Mypy is the main static type checker, tightly integrated with the development of static typing features in the language—but Pyright and Pyre are also solid tools. PyLint and PyFlakes are the main “logical linters”, looking ...
Top answer
1 of 2
1

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.

2 of 2
0

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.

🌐
Kanaries
docs.kanaries.net › topics › Python › python3-linter
Python3 Linter: The Ultimate Guide to Boosting Your Code Quality – Kanaries
August 17, 2023 - In the Python universe, some of the most popular linters include Pylint, Flake8, and PyCodeStyle. Each of these linters has its strengths and features that cater to different needs and preferences. Choosing the "best" Python linter can be subjective, as the best choice often depends on your ...
🌐
Better Stack
betterstack.com › community › guides › scaling-python › ruff-explained
Linting with Ruff: A Fast Python Linter | Better Stack Community
Ruff is a fast Python linter and code formatter written in Rust that has rapidly gained popularity in the Python ecosystem.
🌐
Real Python
realpython.com › ruff-python
Ruff: A Modern Python Linter for Error-Free and Maintainable Code – Real Python
June 17, 2024 - Now that you’ve learned why you should use a linter and how Ruff is a great tool to help you achieve clean, readable, and error-free code, you should take Ruff for a spin. As mentioned above, there are a plethora of configurations you can use to take your linting to the next level. There are also a few integrations that can speed up your workflow, such as the VS Code extension, PyCharm plugin, pre-commit hook, and GitHub Actions. Ruff is an extremely fast Python linter and code formatter that can help you improve your code quality and maintainability.
🌐
Klipper
klipper.discourse.group › developers
Python linter and tests - Developers - Klipper
April 15, 2024 - Hello. Have you thought about using linter and tests for python? For example flake8 and pytest. Right now some modules of the project are very hard to read, ran flake8 to look and got hundreds of errors. The more the pro…