-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Replacing ~autoflake, isort, and~ black with Ruff #101
Comments
I started experimenting with this recently - master...use-ruff - and from memory the barriers were
If you're interested in trying this out on ruff 0.1 and reporting upstream issues as needed, I think that would substantially accelerate things! My best guess for when I'd get back to it otherwise is "maybe December, maybe January, maybe later" 😅 |
Oh awesome - I'll play around with it in a fork and see how I go, though I also wouldn't have high hopes of getting anywhere soon. |
another way of solving this would be to add a flag that configures which tools within shed that are run. Especially when there's some custom refactors that only exists within shed I see it as pretty valuable to have a way of accessing them without having to pull in all the other assumptions shed makes, so even if not going all the way of enabling/disabling individual tools I could see a Ruff does also implement pyupgrade as well. |
I'm generally against configuration options, and would prefer to just hold off until a ruff-based implementation can fully replace them. Shipping a second CLI entrypoint, e.g. |
yeah that works. Not having any configuration of black/autoflake/isort makes decent sense, but locking one out of configuring ruff is quite limiting. Though the PR does open up letting ruff read it's config file which does address that.
|
@OtherBarry - I'd like to (continue) supporting formatting code from stdin on a read-only filesystem. This might mean that we have to wait for ruff's upcoming python interface before shed will support it. @jakkdl if someone wants to configure ruff, I encourage them to use ruff! The whole point of shed is that it's the last formatting decision you need to make 😉 |
https://docs.astral.sh/ruff/configuration/#the-config-cli-flag means we can now run in |
We still haven't replaced |
With the beta release of Ruff's formatter, ruff now contains the functionality of several of the tools in shed, and runs much faster.
See the ruff docs for the functionality it replaces:
I love the pyupgrade and refactor aspects of shed, but it's difficult to use with ruff, as the minor deviations mean I have to run ruff format, run shed, then run ruff format again in order to get the most out of both tools, which then negates a lot of the speed benefits of ruff.
Personally I think ruff should replace those tools within shed, but I would also be happy to have it as an option.
Happy to try for a PR of this if it's something other people are interested in.
The text was updated successfully, but these errors were encountered: