finch icon indicating copy to clipboard operation
finch copied to clipboard

Code formatter?

Open vkostyukov opened this issue 10 years ago • 3 comments

There is a code formatter for Scala: https://github.com/mdr/scalariform. We might think about enabling it.

vkostyukov avatar Feb 16 '15 23:02 vkostyukov

I'm not sure we should do this. Code formatters are not that flexible and will require a lot of tuning of its options to get it to a place we are comfortable with. I enabled it on the core project locally and it does some interesting things. For example it renders:

  def flatMap[S, B](fn: A => PRequestReader[S, B])(
    implicit ev: R %> S
  ): PRequestReader[R, B] = new PRequestReader[R, B] {

as

  def flatMap[S, B](fn: A => PRequestReader[S, B])(
    implicit
    ev: R %> S
  ): PRequestReader[R, B] = new PRequestReader[R, B] {

I'm imagine there is an option to change this behavior, and I'm going play with it a little to see if I can get it in a more reasonable state, but I'm not really sold on it. I think Wartremover and scalastyle are better options for enforcing format.

rpless avatar Jun 09 '15 13:06 rpless

Yeah. That's a weird style for sure. Maybe we can grab an initial config from some open source project that uses scalariform? That's basically what I did wit scalastyle (grabbed it from cats).

vkostyukov avatar Jun 09 '15 18:06 vkostyukov

I think we should do that now. Everybody seems to be using scalafmt nowadays.

vkostyukov avatar Oct 02 '18 17:10 vkostyukov

Scalafmt added in #1267

joroKr21 avatar Sep 16 '22 12:09 joroKr21