prettier-plugin-solidity icon indicating copy to clipboard operation
prettier-plugin-solidity copied to clipboard

about line break rule

Open gzliudan opened this issue 3 years ago • 3 comments

If a function have more than 2 parameters or more than 2 return values, then it will be breaked into serveral lines. Is there a new rule which will not break line, or only break line according to line length(printWidth)?

function getName(uint256 a, uint256 b, uint256 c) external view returns (uint256 d, uint256 e, uint256 f);

becomes:

function getName(
        uint256 a,
        uint256 b,
        uint256 c
    )
        external
        view
        returns (
            uint256 d,
            uint256 e,
            uint256 f
        );

gzliudan avatar Dec 21 '21 13:12 gzliudan

@gzliudan I think this is by design, you may want to try to skip specific lines maybe? cc @fvictorio

mattiaerre avatar Dec 27 '21 19:12 mattiaerre

Really need a rule to control the parameter count. Have any ideas?

pofulu avatar Feb 02 '22 06:02 pofulu

Hey, did you find a solution for this? Those line breaks are driving me crazy...

0xBronko avatar Jul 07 '22 16:07 0xBronko

I am too of the opinion that the default behaviour here is suboptimal, see #755.

istankovic avatar Nov 21 '22 12:11 istankovic

This has been addressed as we moved into v1.0.0

Janther avatar Nov 21 '22 23:11 Janther