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

forge fmt doesn't format contract instantiation arguments #4619

Closed
2 tasks done
Philogy opened this issue Mar 21, 2023 · 2 comments · Fixed by #6408
Closed
2 tasks done

forge fmt doesn't format contract instantiation arguments #4619

Philogy opened this issue Mar 21, 2023 · 2 comments · Fixed by #6408
Labels
C-forge Command: forge Cmd-forge-fmt Command: forge fmt T-bug Type: bug

Comments

@Philogy
Copy link

Philogy commented Mar 21, 2023

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What command(s) is the bug in?

forge 0.2.0 (394f217 2023-03-21T00:03:24.86Z)

Operating System

Linux

Describe the bug

forge fmt does not seem to format contract instantiation statements such as:

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

contract B {
    constructor(uint256 a, uint256 b, uint256 c) {}
}

contract A {
    function f() public {
        new B (1, 3,


               4);
    }
}

Running forge fmt with the above in the repo will not correct the new B statement to the expected new B(1, 3, 4);\n but instead leaves it as is. Other statements in the same file are still formatted as expected.

@Philogy Philogy added the T-bug Type: bug label Mar 21, 2023
@gakonst gakonst added this to Foundry Mar 21, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 21, 2023
@mds1 mds1 added C-forge Command: forge Cmd-forge-fmt Command: forge fmt labels Mar 22, 2023
@fubhy
Copy link
Contributor

fubhy commented May 25, 2023

Same with e.g. new address[]( ... )

@beeb
Copy link
Contributor

beeb commented Nov 23, 2023

I can take this one if no-one started yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-fmt Command: forge fmt T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants