skip to content
~/bermudev/blog

Ruff: A Fast Rust-based Python Linter

/ 2 min read

In recent weeks there has been considerable talk in the Python community about a new linter that may come to replace the already more than consolidated Flake8 or Pylint. This new linter is called Ruff.

What is Ruff?

Ruff is a linting tool for Python, that like all other linters, analyzes your code for potential errors, style violations, and other issues that could impact the quality and readability of your code. It provides a comprehensive set of rules that help you maintain consistency and best practices in your codebase, which makes it easier for you and your colleagues to work on and understand the code.

What makes it so special?

One of the most impressive aspects of Ruff is its speed. Some tests show that it is considerably better than its alternatives.

Ruff chart

In the following video you can see a comparison in the analysis time of large libraries such as TensorFlow, where Ruff is more than 16 times faster than Flake8 (from 56.1 seconds to 3.4 seconds) and more than 69 times faster than Pylint (from 179.8 seconds to 2.5 seconds).

More about Ruff

You can learn more about Ruff on their website, in their repository, and watch below an interesting video from the friends at JetBrains where they explain and exemplify in more depth all its features and possibilities.