forked from teddav/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fmt): respect bracket spacing in named function call (foundry-rs#…
…4363) * fix(fmt): respect bracket spacing in named function call * fix function call test
- Loading branch information
Showing
5 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// config: line_length = 120 | ||
// config: bracket_spacing = true | ||
contract FunctionCall { | ||
function foo() public pure { | ||
bar(1111111111111111111111111111111111111111111111111111, 111111111111111111111111111111111111111111111111111); | ||
bar(1111111111111111111111111111111111111111111111111112, 1111111111111111111111111111111111111111111111111112); | ||
bar(1111111111111111111111111111111111111111111111111113, 11111111111111111111111111111111111111111111111111113); // the semicolon is not considered when determining line break | ||
bar( | ||
1111111111111111111111111111111111111111111111111114, 111111111111111111111111111111111111111111111111111114 | ||
); | ||
bar( | ||
111111111111111111111111111111111115, | ||
11111111111111111111111111111111115, | ||
11111111111111111111111111111111115 | ||
); | ||
bar( | ||
111111111111111111111111111111111111111111111111111116, | ||
111111111111111111111111111111111111111111111111111116 | ||
); | ||
bar( | ||
111111111111111111111111111111111111111111111111111117, | ||
1111111111111111111111111111111111111111111111111111117 | ||
); | ||
} | ||
|
||
function bar(uint256, uint256) private pure { | ||
return; | ||
} | ||
} | ||
|
||
function a(uint256 foo) { | ||
foo; | ||
} | ||
|
||
function b() { | ||
a({ foo: 5 }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,11 @@ contract FunctionCall { | |
return; | ||
} | ||
} | ||
|
||
function a(uint256 foo) { | ||
foo; | ||
} | ||
|
||
function b() { | ||
a({foo: 5}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,11 @@ contract FunctionCall { | |
return; | ||
} | ||
} | ||
|
||
function a(uint256 foo) { | ||
foo; | ||
} | ||
|
||
function b() { | ||
a( {foo: 5} ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters