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

Integrate with ruff #190

Closed
justinchuby opened this issue Jan 25, 2023 · 4 comments
Closed

Integrate with ruff #190

justinchuby opened this issue Jan 25, 2023 · 4 comments

Comments

@justinchuby
Copy link

I enjoyed using refurb to keep my code clean and fresh. Naively I think it would be awesome to integrate refurb's rules to https://github.com/charliermarsh/ruff to take advantage of its fast speed.

@dosisod
Copy link
Owner

dosisod commented Jan 26, 2023

I haven't played around with Ruff yet, but from what I can see it looks promising. The issue with integrating Refurb and Ruff together is that it would require re-writing Refurb in Rust, and then updating both Refurb and the upstream Ruff whenever a check or update is added. With that in mind, it would make more sense that Refurb be merged into Ruff, meaning the refurb package would cease to exist. An alternative would be to use/fork Ruff and only implement the checks that Refurb cares about, that way Refurb can still be a standalone application, but benefit from the speed of Ruff.

All in all, this is going to be a lot of work. I will (eventually) look into this more to see if it is feasible, but for the time being I feel as though Refurb should be left as it is. I am open to others investigating or implementing this, but I myself will not be working on it.

Thank you for opening this issue though! Refurb is slow, and I am looking at ways to make it faster. Ruff might be the answer, though it will take some investigation to say for sure.

@sbrugman
Copy link
Contributor

sbrugman commented Feb 11, 2023

Note that we started by porting a couple of pathlib rules from refurb! (They are categorized under flake8-use-pathlib for conciseness, but should receive FURBXXX alias codes)

Ruff could be included in the "Comparison To Other Tools" section in the readme. Since refurb is built on top of mypy, it has more type information than ruff. This is similar to some rules in pylint.

ps. Great tool, especially love philosophy "it is meant for making good code even better."

@dosisod
Copy link
Owner

dosisod commented Feb 13, 2023

This is really cool! I am glad to see these sorts of checks get adopted by other tools. Another feature of Ruff I didn't see before is the autofixing capabilities, which is another thing I eventually want to implement in Refurb at some point.

And I will make sure to look at Ruff so I can add a comparison to the readme! I might even consider replacing flake8 with Ruff for linting in this project since it does a lot more than flake8 out of the box.

@dosisod
Copy link
Owner

dosisod commented Jul 22, 2023

Closing this. There is an open issue on the Ruff repo tracking which Refurb checks have been added, so anyone looking for updates on Refurb checks that are added to Ruff should look there!

@dosisod dosisod closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants