MITB Banner

Ruff, the New Rust-Based Python Linter for Programmers

Although written in Rust, Ruff can be installed through pip, like other command-line tools.

Share

Should we call Rust a Failed Programming Language?
Listen to this story

Former Spring Discovery and Khan Academy staff engineer Charlie Marsh recently released the latest version of ‘Ruff’, a  fast Python linter written in Rust.

Ruff can support over 200 lint rules and is now being used in big open-source projects such as FastAPI, Bokeh, Zulip, and Pydantic. 

In comparison to Flake8, Ruff is approximately 150 times faster on macOS, 75 times faster than pycodestyle, and 50 times faster than pyflakes and pylint, among others.

The difference between receiving real-time feedback (roughly 300 and 500 milliseconds) and waiting for 12 or more seconds is 25 times, at least. With a 150-times speed increase, the difference becomes a mere 300–500 milliseconds compared to 75 seconds. Ruff’s total processing time for a single file in CPython is about 60 milliseconds, making it faster. 

Ruff employs RustPython’s AST parser and implements its own AST traversal, visitor abstraction, and lint-rule logic. In addition, it supports Python 3.10, consisting of the new pattern-matching syntax.

Ruff can be installed through pip, like other command-line tools.

Like ESLint, Ruff enables caching, allowing single-file code linting and CPython codebase linting in 60 ms. Ruff also includes file watching similar to TypeScript, making it a persistent linter that restarts when the source code is altered. Ruff supports pyproject.toml-based setup, which is becoming more popular in the Python community.

Advertisement

Order the latest Book by Dinesh Pundri

[Update: 16 February 2023 15:32 | Previously, the headline erroneously mentioned that Ruff is a programming language instead of Python Linter. The headline has now been updated to reflect the changes.]

Share
Picture of Shritama Saha

Shritama Saha

Shritama (she/her) is a technology journalist at AIM who is passionate to explore the influence of AI on different domains including fashion, healthcare and banks.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.