-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
coreRelated to core functionalityRelated to core functionalityformatterRelated to the formatterRelated to the formatter
Milestone
Description
This issue is the public kickoff for Ruff's autoformatting effort.
A few comments on how I'm thinking about the desired end-state:
- The goal is to enable users to replace Black with Ruff. So, ideally, new projects could come in and replace pyflakes, pycodestyle, isort, and black with a single tool (Ruff).
- As with the rest of Ruff, autoformatting will be entirely optional. You can continue to use Ruff alongside Black. You can also use Ruff just as an autoformatter.
- I'd like to adhere to Black's formatting choices as much as possible, but exact 1:1 parity with Black is not a goal. I'm comfortable deviating when we can make a compelling case, but I'd like that case to be based on arguments that are unrelated to code style itself (e.g., simpler implementation).
- I'd like to enable slightly more configuration than is possible with Black (see: Replacing black and blue? #813), using Prettier as a model. Prettier allows you to specify the line-length, tab width, quote style, trailing comma behavior, and one or two other stylistic features. I think it's reasonable to support at least line length, indentation, and quote style, so I plan to start there. (It's not a goal to be as flexible as, say, Rustfmt.)
With big projects like this, I work best by taking some time to hack on possible implementations, so I'd like to do some free exploration before opening up the issue to other contributors. But I'd love to hear feedback on the above (and any tips you may have) as I start working on this.
YoniChechik, Gotos, chopeen, simjak, vially and 79 moreofek, colin99d, tekumara, skykasko, nikolaik and 151 more
Metadata
Metadata
Assignees
Labels
coreRelated to core functionalityRelated to core functionalityformatterRelated to the formatterRelated to the formatter