New Python Linter/Formatter Written In Rust

32 views
Skip to first unread message

Thomas Passin

unread,
Oct 25, 2023, 10:00:41 AM10/25/23
to leo-editor
Possibly of interest for Leo to replace pylint, etc -

Edward K. Ream

unread,
Oct 25, 2023, 10:09:15 AM10/25/23
to leo-e...@googlegroups.com
On Wed, Oct 25, 2023 at 9:00 AM Thomas Passin <tbp1...@gmail.com> wrote:
Possibly of interest for Leo to replace pylint, etc -


Leo's full-test-leo.cmd file uses ruff. However, ruff almost never reports a problem.

I still use pylint occasionally. It reports problems that ruff doesn't.

Edward

Edward K. Ream

unread,
Oct 25, 2023, 10:24:38 AM10/25/23
to leo-e...@googlegroups.com
Thomas Passin wrote:


Oops. I see you were talking about ruff's new formatter.

The formatter claims 99.9% compatibility with black. That's a problem because black insists on reformatting Leo's sentinel comments.

ruff boasts configuration options that black lasts. The ruff devs may be receptive to adding motr settings. Here's what I want:

-  A setting that would suppress the reformatting of Leo's sentinel comments.
   Imo the best would be a regex that would leave comments alone when it matches.
   Something like `^#@`.
- Settings that would specify a range of line-lengths to leave alone.
  The idea: add hysteresis to line-length computations.
- A setting that would suppress all line breaks/joins.

We'll see what the ruff devs say. Many thanks for your heads up.

Edward

Edward K. Ream

unread,
Oct 30, 2023, 10:41:26 AM10/30/23
to leo-editor
On Wednesday, October 25, 2023 at 9:24:38 AM UTC-5 Edward K. Ream wrote:
Here's what I want:

-  A setting that would suppress the reformatting of Leo's sentinel comments.
   Imo the best would be a regex that would leave comments alone when it matches.
   Something like `^#@`.
- Settings that would specify a range of line-lengths to leave alone.
  The idea: add hysteresis to line-length computations.
- A setting that would suppress all line breaks/joins.

We'll see what the ruff devs say. Many thanks for your heads up.

On second thought, I'm going to add these features myself in a fork. It will be a good first rust project -)

I'll contact the ruff devs if/when I create a PR that does what I want.

Edward
Reply all
Reply to author
Forward
0 new messages