Add rome_formatter fork as ruff_formatter - #2872
Conversation
|
\cc @MichaReiser |
6d25ac2 to
f282c44
Compare
MichaReiser
left a comment
There was a problem hiding this comment.
LGTM
Some things to consider:
- Should we re-license the crates
- Can we document the use of prior work in an acknowledgment section (pylint, Rome, Prettier...)
- It's probably worth unifying the logging infrastructure. Rome uses
tracingwhereas Ruff uses some other crates.
| name = "ruff_formatter" | ||
| version = "0.0.0" | ||
| edition = "2021" | ||
| authors = ["Rome Tools Developers and Contributors"] |
There was a problem hiding this comment.
You may want to change the authors to Ruff.
There was a problem hiding this comment.
I wasn't certain what the "right" pattern was here. I noticed (e.g.) that rome_rowan has authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"].
Ah yeah. How should this work? We already include a bunch of licenses in our
Good idea -- I'll do this in a separate PR.
Also a good idea -- I'll also do this in a separate PR. |
f282c44 to
da633e5
Compare
I'm not really familiar with re-licensing but adding another copyright seems to work (if that's even something we want) https://gist.github.com/fbaierl/1d740a7925a6e0e608824eb27a429370 |
The Ruff autoformatter is going to be based on an intermediate representation (IR) formatted via Wadler's algorithm. This is architecturally similar to Rome, Prettier, Skip, and others.
This PR adds a fork of the
rome_formattercrate from Rome, renamed here toruff_formatter, which provides generic definitions for a formatter IR as well as a generic IR printer. (We've also pulled inrome_rowan,rome_text_size, androme_text_edit, though some of these will be removed in future PRs.)Why fork?
rome_formattercontains code that's specific to Rome's AST representation (e.g., it relies on a fork of rust-analyzer'srowan), and we'll likely want to support different abstractions and formatting capabilities (there are already a few changes coming in future PRs). Once we've droppedruff_rowanand trimmed downruff_formatterto the code we currently need, it's also not a huge surface area to maintain and update.