You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the configuration for the formatter is implemented, we should write a tool, let's call it black_to_ruff, that automatically migrates as much of the black configuration to ruff configuration as possible. This should be based on or extend flake8_to_ruff which already reads some basic black config.
Read the black configuration: line-length, target-version, skip-magic-trailing-comma, preview, include, exclude
Find the relevant ruff configuration, pyproject.toml or ruff.toml`
Ignore redundant options, warn and ignore for conflicting options
rewrite (toml_edit) the toml configuration file
The text was updated successfully, but these errors were encountered:
konstin
changed the title
blake_to_ruff: automated migration of black configuration settingsblack_to_ruff: automated migration of black configuration settings
Sep 20, 2023
I'm sort of medium on this, based on my experience with flake8-to-ruff. It's a nice idea in theory but ends up being a pain to translate from another tool's settings to our own (for example, how would we do includes and excludes, where Black uses a single regular expression?). And the payoff hasn't been great since it's a one-time tool. (Perhaps the discoverability is low given that it's a separate package and not a subcommand.) My hope is that our configuration is close enough to Black's that the migration should be trivial to do by-hand...
This isn't a hard no, but rather, I question whether it's a worthwhile investment (upfront and in ongoing maintenance) vs. other areas.
I'm gonna close this as I'd prefer not to invest effort here. There are few enough configuration knobs that it's probably easy to just port the configuration than to download and figure out how to run a separate tool :)
Once the configuration for the formatter is implemented, we should write a tool, let's call it
black_to_ruff
, that automatically migrates as much of the black configuration to ruff configuration as possible. This should be based on or extendflake8_to_ruff
which already reads some basic black config.pyproject.toml or
ruff.toml`The text was updated successfully, but these errors were encountered: