Skip to content
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

Move forc's fmt command support into a dedicated forc-fmt plugin crate #1196

Merged
merged 2 commits into from
Apr 8, 2022

Conversation

mitchmindtree
Copy link
Contributor

Follow-up to #1178.


This slims down forc a little further, and matches cargo's behaviour of shipping the formatter under a dedicated plugin. In cargo's case, many folk aren't even aware cargo fmt is provided by a plugin! I think we can provide an on-par experience once we get a forcup tool or similar going.

In the meantime (once they're published) you can install forc with the forc-fmt plugin crate like so:

$ cargo install forc forc-fmt

For sway devs who wish to install from local src, the best one-liner I can think of is:

$ cargo install --path ./forc ; cargo install --path ./forc-fmt

This also removes the FormatError type in favour of using the strictly more flexible anyhow::Error.

In preparation for removing internal support for formatting from `forc`
as a part of an ongoing effort toward slimming down `forc`'s dependency
graph.
Copy link
Contributor

@iqdecay iqdecay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@mitchmindtree mitchmindtree merged commit b9aeebf into master Apr 8, 2022
@mitchmindtree mitchmindtree deleted the mitchmindtree/forc-fmt-plugin branch April 8, 2022 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants