New Ultra-fast replacement for pylint/flake8

18 views
Skip to first unread message

Thomas Passin

unread,
Jun 28, 2023, 10:17:50 AM6/28/23
to leo-editor
Ruff is a new-ish linter program that does the job of pylint or flake8 but is 100 times or more faster because it is written in Rust.  It might be worth looking at for Leo.  

Here's one of the testimonials:

Nick Schrock, founder of Elementl, co-creator of GraphQL:

Why is Ruff a gamechanger? Primarily because it is nearly 1000x faster. Literally. Not a typo. On our largest module (dagster itself, 250k LOC) pylint takes about 2.5 minutes, parallelized across 4 cores on my M1. Running ruff against our entire codebase takes .4 seconds.


It's pypi-installable so presumably usable without executing an external program.

Edward K. Ream

unread,
Jun 28, 2023, 11:39:14 AM6/28/23
to leo-e...@googlegroups.com
On Wed, Jun 28, 2023 at 9:17 AM Thomas Passin <tbp1...@gmail.com> wrote:
Ruff is a new-ish linter program that does the job of pylint or flake8 but is 100 times or more faster because it is written in Rust.  It might be worth looking at for Leo.  

Oh yeah!

Edward

Edward K. Ream

unread,
Jun 28, 2023, 12:11:55 PM6/28/23
to leo-editor
On Wednesday, June 28, 2023 at 9:17:50 AM UTC-5 tbp1...@gmail.com wrote:

> Ruff...is 100 times or more faster because it is written in Rust. 

Wow. ruff does the flake8 tests instantly. Here is the output of a script that checks leo/core and leo/commands with a line length (given in pyproject.toml) of 120.

ruff leo/core
leo\core\leoCommands.py:601:23: E741 Ambiguous variable name: `l`
leo\core\leoFileCommands.py:2161:15: E741 Ambiguous variable name: `l`
leo\core\leoserver.py:5487:121: E501 Line too long (132 > 120 characters)
Found 3 errors.
ruff leo/commands

I'm not sure whether ruff is doing pylint checks.

Edward
Reply all
Reply to author
Forward
0 new messages