Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ruff linter for python #4301

Closed
TheEdgeOfRage opened this issue Sep 5, 2022 · 9 comments
Closed

Add support for ruff linter for python #4301

TheEdgeOfRage opened this issue Sep 5, 2022 · 9 comments
Labels
new tool Support for new linters, fixers, etc.

Comments

@TheEdgeOfRage
Copy link

TheEdgeOfRage commented Sep 5, 2022

Name: ruff
URL: https://github.com/charliermarsh/ruff

Ruff is a new Python linter written in Rust that promises to be 10-100x faster than other linters (They provide benchmarks that seem to prove them correct). It seems like an interesting project and might be worth adding support for in Ale.

@TheEdgeOfRage TheEdgeOfRage added the new tool Support for new linters, fixers, etc. label Sep 5, 2022
@ssokolow
Copy link

I do effectively all my linting through ALE, so this would be valuable to me.

I'd contribute a patch myself but, at the moment, I've had to put a hold on all new things to focus on clearing out backlogged mess. Someday maybe, given how helpful it'd be to have that speedup.

@mfurquimdev
Copy link

This was already merged. Should this issue be closed?

@dvzrv
Copy link

dvzrv commented Dec 10, 2022

@w0rp: It would be awesome if you could tag a release for this.

We have this plugin available on Arch Linux (and I have just added ruff to the list of official packages as well), but currently the integration is unfortunately not there.
Thanks a lot!

@hsanson
Copy link
Contributor

hsanson commented Dec 10, 2022

Ruff is already supported by ALE. Closing.

@hsanson hsanson closed this as completed Dec 10, 2022
@dvzrv
Copy link

dvzrv commented Dec 17, 2022

@hsanson Yes, but for this to arrive in downstream packages, it needs a release. Could you create one? That would be very much appreciated! :)

@hsanson
Copy link
Contributor

hsanson commented Dec 18, 2022

I see. Releases are done by @w0rp so we would have to wait until @w0rp has some time to do the release. Sorry.

@jgb
Copy link

jgb commented Dec 20, 2022

@yining could it be that there is a bug in #4347 ?
The first time I try to do :ALEFix on a newly opened python file, I get the error There is no fixer named ruff.
When I then do an :ALELint, and then retry :ALEFix, the fix works fine.
Repeated this with several python files. Fix won't work until I first run a lint. After the first lint, fix works fine.

My ALE config:

let g:ale_linters = { 'python': ['ruff', ], }
let g:ale_fixers = { '*': ['remove_trailing_lines', 'trim_whitespace'], 'python': ['ruff', 'black'], }

@yining
Copy link
Contributor

yining commented Dec 20, 2022

Hi @jgb

  1. Thanks for the bug report;
  2. I did replicate the bug, and feel sorry about it :-(
  3. I will fix it with a PR ASAP.

yining added a commit to yining/ale that referenced this issue Dec 21, 2022
this commit fixes the issue reported at:
dense-analysis#4301 (comment)

it also had some code refactored and
tests added for ruff as fixer (missed in PR dense-analysis#4347).
@yining
Copy link
Contributor

yining commented Dec 21, 2022

@jgb could you please help check if the PR #4393 fixed the bug? thanks.

hsanson pushed a commit that referenced this issue Dec 22, 2022
this commit fixes the issue reported at:
#4301 (comment)

it also had some code refactored and
tests added for ruff as fixer (missed in PR #4347).
mnikulin pushed a commit to mnikulin/ale that referenced this issue Nov 12, 2023
this commit fixes the issue reported at:
dense-analysis#4301 (comment)

it also had some code refactored and
tests added for ruff as fixer (missed in PR dense-analysis#4347).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new tool Support for new linters, fixers, etc.
Projects
None yet
Development

No branches or pull requests

7 participants