-
Notifications
You must be signed in to change notification settings - Fork 901
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
Split out a rustfmt-core crate #1583
Comments
Could there be a I have done a very quick prototype and it seemed to be possible. |
That sounds like a good idea! We could also have the config stuff in rustfmt-core, and have a feature for that crate. |
this seems to be fixed? |
Probably. But I do want to check that it has the right API, etc. We also need a way to work with workspaces and the Rust repo before this is done. |
AFAIK, we cannot use workspace to separate crates as long as rustfmt is registered as a submodule under the rustc repo. We could still have multiple crates under the same repository without using workspace, however (like we currently do with rustfmt-config-proc-macro). Starting from 2.0, I would like to re-organize this repo into something like the following:
...that is, we will have three crates inside this repo: |
Motivation is to have a crate which can be used as a library (e.g., by RLS, Rustdoc) with minimal deps.
We would split out a rustfmt-bin crate which would include the current bin directory, anything for parsing config files, doing diffs, output to terminal, etc. The rustfmt-core crate would be left with just the core reformatting stuff. The trickiest bit of this is that the core crate will need to contain the actual in-memory config, but the config file parsing should be in the bin crate. I think that means we either have to define the config in two places (not very DRY, but tolerable) or use a fancy build script.
The text was updated successfully, but these errors were encountered: