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 can't handle // forgefmt: disable-next-line with a comment on the next line #7920

Open
2 tasks done
duncancmt opened this issue May 13, 2024 · 0 comments
Open
2 tasks done
Labels
T-bug Type: bug

Comments

@duncancmt
Copy link

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (a117fbf 2024-05-13T00:18:52.080591906Z)

What command(s) is the bug in?

forge fmt

Operating System

Linux

Describe the bug

src/example.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;

contract Dummy {
    // forgefmt: disable-next-line
    function dummy() external returns (uint256) { // comment
        return 0;
    }
}
$ forge fmt
Error: 
Failed to construct valid Solidity code for src/example.sol. Leaving source unchanged.
Debug info: [Diagnostic { loc: File(0, 140, 147), level: Error, ty: ParserError, message: "unrecognised token 'uint256', expected \";\", \"case\", \"constant\", \"default\", \"external\", \"immutable\", \"internal\", \"leave\", \"override\", \"payable\", \"private\", \"public\", \"pure\", \"return\", \"returns\", \"revert\", \"switch\", \"view\", \"virtual\", \"{\", identifier", notes: [] }]
@duncancmt duncancmt added the T-bug Type: bug label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

1 participant