-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Copy link
Labels
C-forgeCommand: forgeCommand: forgeCmd-forge-fmtCommand: forge fmtCommand: forge fmtT-bugType: bugType: bug
Description
Component
Other (please describe)
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
1.6.0-dev
What version of Foundryup are you on?
foundryup: 1.5.0
What command(s) is the bug in?
forge fmt
Operating System
None
Describe the bug
This is a follow up for the issue #13555 . I have made the fix in #13560 but I think this issue deserves its own report.
The issue #13555 shows that, previously forge fmt formats the following statement incorrectly.
// before forge fmt
if (condition) { execute(); execute(); }
// after forge fmt
if (condition) execute();
execute();This got fixed, but the issue remains. Now for the nested if statement, forge fmt still formats incorrectly.
// before forge fmt
if (condition) if (condition) { execute(); execute(); }
// after forge fmt
if (condition) if (condition) execute();
execute();More incorrectly-formatted tests can be seen in the commit daf10d2
Impact-wise, we rarely see nested if as above, but while (cond) if (cond) { ... } is more likely to be seen.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-forgeCommand: forgeCommand: forgeCmd-forge-fmtCommand: forge fmtCommand: forge fmtT-bugType: bugType: bug
Type
Projects
Status
Backlog