-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
refactor(fmt): change default for override_spacing
to false
#4023
refactor(fmt): change default for override_spacing
to false
#4023
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens when there's no override target? i.e. it's just override
because you have is Base1
eef54b5
to
24037c7
Compare
I wanted to test this but unfortunately the newest
Cc-ing @rkrasiuk in case he can take a look? |
@PaulRBerg ugh, must be some config issue, looking |
@PaulRBerg the issue is unrelated, couple of latest releases failed |
Thanks, Roman, I will wait for the fix and try test again with only one base contract inherited. |
@PaulRBerg openssl got pulled into foundry again 😢 . we added a fix and CI check to prevent this from happening again. will re-release as soon as the fix is merged and ping you |
@gakonst in general, some tests need to be fixed with this change to mirror the default behavior. the exact issue on the screenshot is due to bad rendering. here's this branch on cli |
override_spacing
to false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulRBerg there are some tests that need to be fixed to depict the changed default behavior. there are 3 override-spacing.fmt.sol
files in testdata. the easiest way forward is to rename these to fmt.sol
files and remove // config: override_spacing = false
line (since this is now the default). the original fmt.sol
files should be renamed to override-spacing.fmt.sol
and should include // config: override_spacing = true
at the top
@PaulRBerg just checked, |
Thanks for the quick turnaround, @rkrasiuk! I can confirm that Re tests - thanks for the guidance! I have updated them to match the new default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, will merge after checks pass
@PaulRBerg seems like some other files with default behavior need to be fixed as well |
fd42b20
to
24037c7
Compare
24037c7
to
2fbe898
Compare
@rkrasiuk I took a look at the CI logs but I don't know what to make out of them .. I don't understand what went wrong. Looks like the "" formatting is the same as the ""? |
@PaulRBerg the CI logs do not show the space diff for some reason (see my response to @gakonst above). fixing the tests |
…erg/foundry into default-variable-override-spacing
Oh, I see. Sorry for the back-and-forth, and thanks for the fix. |
Motivation
The Solidity documentation uses no spacing between the
override
keyword and the overridden contract names:Anecdotally, most Solidity code bases I've seen adhere to the same pattern where there is no spacing. This is perhaps the same reason why @benesjan opened issue #3522 in the first place.
Solution
Set the default value of
variable_override_spacing
tofalse
.Though, before this is merged in, we should fix #4025 first.