-
Notifications
You must be signed in to change notification settings - Fork 73
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
space-after-if-condition #39
Conversation
Codecov Report
@@ Coverage Diff @@
## master #39 +/- ##
===========================================
+ Coverage 52.22% 64.77% +12.55%
===========================================
Files 4 4
Lines 157 159 +2
Branches 34 35 +1
===========================================
+ Hits 82 103 +21
+ Misses 61 49 -12
+ Partials 14 7 -7
Continue to review full report at Codecov.
|
it fails if you run Difference:
- Expected
+ Received
@@ -155,15 +155,16 @@
],
"type": "Block",
},
"isConstructor": true,
"modifiers": Array [],
- "name": null,
+ "name": "BasicIterator",
"parameters": Object {
"parameters": Array [],
"type": "ParameterList",
},
+ "returnParameters": null,
"stateMutability": null,
"type": "FunctionDefinition",
"visibility": "default",
},
Object {
66 | expect(ppastMassaged).toBeDefined();
67 | if (!astMassaged.errors || astMassaged.errors.length === 0) {
> 68 | expect(astMassaged).toEqual(ppastMassaged);
| ^
69 | }
70 | });
71 | }
at Object.test (tests_config/run_spec.js:68:33) |
Those are the kinds of issues that the AST-massaging function can handle. |
not sure if I understand what you mean @j-f1 ; shall we change something here? |
I think so. |
@@ -7,7 +7,7 @@ contract BasicIterator { | |||
address creator; // reserve one "address"-type spot | |||
uint8[10] integers; // reserve a chunk of storage for 10 8-bit unsigned integers in an array | |||
|
|||
function BasicIterator() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dah 😅 @j-f1 as we "translate" function ContractName
=> constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin is doing that right now? I mean, converting function Contract
to constructor
? Because that shouldn't be prettier's responsibility IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% agree. Apparently it does that. See if I can fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the parser adds the isConstructor
metadata to functions named as the contract, and the printer function uses that to print constructor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
merging this and opening a new PR to try to fix #32 |
Description
add a line before
ContractDefinition
add space after the condition for
IfStatement
fix Add space before
if
's opening braces #37fix Put
while
opening brace in the same line #38