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

avoid splitting parentheses of a function call without arguments #136

Conversation

Janther
Copy link
Contributor

@Janther Janther commented Jun 6, 2019

halfway fixing #115
still working on splitting function calls on the . character.

@codecov
Copy link

codecov bot commented Jun 6, 2019

Codecov Report

Merging #136 into master will decrease coverage by 0.41%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
- Coverage   97.73%   97.32%   -0.42%     
==========================================
  Files          66       66              
  Lines         441      448       +7     
  Branches       57       58       +1     
==========================================
+ Hits          431      436       +5     
- Misses         10       12       +2
Impacted Files Coverage Δ
src/nodes/FunctionCall.js 100% <100%> (ø) ⬆️
src/clean.js 33.33% <0%> (-66.67%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75a11be...999ece2. Read the comment docs.

}
if (node.arguments && node.arguments.length > 0) {
Copy link
Member

@fvictorio fvictorio Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't come from this PR, but I'm curious. When does a function call have "names" and when does it have "arguments"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will have to double check this one but from the look of the output code, a function call has names when is initializing a struct.

struct FooStruct {
  uint foo;
  uint figther;
}

FooStruct myStruct = FooStruct({foo:1, fighter:2});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, thanks!

@mattiaerre
Copy link
Member

you can rebase now

@Janther Janther force-pushed the bugfix/function_call_without_arguments branch from 324d5a4 to 999ece2 Compare June 12, 2019 02:42
@mattiaerre mattiaerre merged commit 3e8b8c1 into prettier-solidity:master Jun 12, 2019
@Janther Janther deleted the bugfix/function_call_without_arguments branch June 12, 2019 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants