Closed densh closed 8 years ago
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.
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.
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: