finch
finch copied to clipboard
Code formatter?
There is a code formatter for Scala: https://github.com/mdr/scalariform. We might think about enabling it.
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.
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).
I think we should do that now. Everybody seems to be using scalafmt nowadays.
Scalafmt added in #1267