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

Inconsistent formatting for variadic-like code #348

Closed
densh opened this Issue Jun 27, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@densh
Member

densh commented Jun 27, 2016

https://github.com/scala-native/scala-native/blob/master/nativelib/src/main/scala/scala/scalanative/native/FunctionPtr.scala#L11

I'm reasonably happy with the output up until fromFunction15. Afterwards it just explodes size-wise. Inconsistency in formatting is quite glaring, plus the code becomes too big size-wise for no good reason.

Using:

  • 0.2.5
  • --style defaultWithAlign --javaDocs
@sjrd

This comment has been minimized.

Show comment
Hide comment
@sjrd

sjrd Jun 27, 2016

IMO that's a case where you would disable scalafmt for the definition of those functions. They look much too much like generated code, and it's conter-productive to enforce line length on them.

sjrd commented Jun 27, 2016

IMO that's a case where you would disable scalafmt for the definition of those functions. They look much too much like generated code, and it's conter-productive to enforce line length on them.

@olafurpg

This comment has been minimized.

Show comment
Hide comment
@olafurpg

olafurpg Jun 27, 2016

Member

I agree that the output from scalafmt takes too many lines. Bin-packing is probably the way to go to get more compact formatting + more consistency between the longer and shorter functionX. As @sjrd mentions and we discussed in #347, your current option is to disable scalafmt for that file and once #315 is implemented you will be able to enable bin-packing for specific regions of code.

Member

olafurpg commented Jun 27, 2016

I agree that the output from scalafmt takes too many lines. Bin-packing is probably the way to go to get more compact formatting + more consistency between the longer and shorter functionX. As @sjrd mentions and we discussed in #347, your current option is to disable scalafmt for that file and once #315 is implemented you will be able to enable bin-packing for specific regions of code.

@densh

This comment has been minimized.

Show comment
Hide comment
@densh

densh Jun 28, 2016

Member

#315 is a decent solution for this problem.

Member

densh commented Jun 28, 2016

#315 is a decent solution for this problem.

@densh densh closed this Jun 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment