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

Vendor forge-fmt into solang repo #1649

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Conversation

seanyoung
Copy link
Contributor

The published forge-fmt is out date, not maintained and depends on an old version of solang-parser.

This is a copy of forge-fmt:

https://github.com/foundry-rs/foundry/tree/master/crates/fmt

commit: 00854b602ef0e67379a2027ccc5d0aad553e5333

@LucasSte
Copy link
Contributor

LucasSte commented Jun 6, 2024

I don't know if this is much of an effort, but have you considered adding forge-fmt as a submodule or as a git subtree?

@seanyoung
Copy link
Contributor Author

seanyoung commented Jun 6, 2024

I don't know if this is much of an effort, but have you considered adding forge-fmt as a submodule or as a git subtree?

It needs modifications to make it work, and I don't know that that is possible with submodule or subtree.

Having said that, if it could work it would be nice.

Copy link
Contributor

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,22 @@
[package]
name = "forge-fmt"
version = "0.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What version should it have if we rename it to solang-fmt?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we are going to publish it, intuitively should be the same version as solang-parser and solang?

Copy link
Contributor

Choose a reason for hiding this comment

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

However if we just want to vendor it we should keep the original version I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about we just vendor it for now. If we want to publish it, we can always rename it and give it a new version.

@@ -0,0 +1,22 @@
[package]
name = "forge-fmt"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm thinking, should we name it solang-fmt instead? Or do we just copy it over from time to time leaving as much as possible as it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a pretty useful crate TBH. We might want to publish it in the future.

So I agree, why not rename it to solang-fmt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed my mind. Let's just vendor it for now.

version = "0.2.0"
edition = "2021"
authors = ["Foundry Contributors"]
license = "MIT OR Apache-2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this compatible with our license (looks like we have Apache only)?

Comment on lines +7 to +8
homepage = "https://github.com/foundry-rs/foundry"
repository = "https://github.com/foundry-rs/foundry"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intentional? Might be misleading for example if we want to publish it on crates.io but I guess this isn't supposed to be published?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As we're vendoring for now, let's leave it as is

@xermicus
Copy link
Contributor

xermicus commented Jun 6, 2024

Yeah I quickly had the same thought as @LucasSte, however we'd have to modify it anyways and it wouldn't be just forge-fmt but the whole foundry repo.

@xermicus
Copy link
Contributor

xermicus commented Jun 7, 2024

@seanyoung also noticed the PR title could be renamed to "Vendor forge-fmt into solang" as it would explain the reasoning of why we need this :)

@seanyoung seanyoung changed the title Copy forge-fmt into solang crate Vendor forge-fmt into solang crate Jun 10, 2024
The published forge-fmt is out date, not maintained and depends on an
old version of solang-parser.

This is a copy of forge-fmt:

https://github.com/foundry-rs/foundry/tree/master/crates/fmt

commit: 00854b602ef0e67379a2027ccc5d0aad553e5333

Some minor modifications were needed to make it work with the new parse
tree.

Signed-off-by: Sean Young <[email protected]>
@seanyoung seanyoung changed the title Vendor forge-fmt into solang crate Vendor forge-fmt into solang repo Jun 10, 2024
@seanyoung
Copy link
Contributor Author

The windows failure is unrelated to this PR

@seanyoung seanyoung merged commit d8c5d24 into hyperledger:main Jun 10, 2024
17 of 18 checks passed
@seanyoung seanyoung deleted the forge-fmt branch June 10, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants