monix / shade

Memcached client for Scala
MIT License
106 stars 19 forks source link

Apply format by scalariform #24

Closed zaneli closed 8 years ago

zaneli commented 8 years ago

Some differences occurs by running sbt clean test:compile because of using sbt-scalariform.

I think these should be treated as default, but what do you think?

lloydmeta commented 8 years ago

Strange, the code was formatted this way after I added Scalariform.

zaneli commented 8 years ago

Oh...sorry, this might occur at only my development environment?

But I guess it seems to be preserveDanglingCloseParenthesis default behavior. ref: https://github.com/mdr/scalariform#preservedanglingcloseparenthesis

lloydmeta commented 8 years ago

Yes, it turns out my global Scala-style plugin was interfering with Scalariform and causing this strange behaviour. Removing it and then compiling the code gave me the same changeset so I'll merge this.

zaneli commented 8 years ago

@lloydmeta Thank you for merge it, but I am confused...

sbt-scalariform 1.3.0 default settings seems to be (PreserveDanglingCloseParenthesis, true). https://github.com/sbt/sbt-scalariform/blob/7cc74a7a43ccbd766f828a9a7c345c01cf717853/src/main/scala/com/typesafe/sbt/SbtScalariform.scala#L50

Would it be actually reasonable to merge my PR?

lloydmeta commented 8 years ago

I think your changeset is correct in that it formats it in a way that prevents churn due to formatting and reformatting. I just tried clean test:compile in a fresh dev environment (without any global plugins etc), and got the same results, so I think we are fine here.

If/when Scalariform's default setting change to preserve dangling parens, we can adapt that or decide which way we want to go. I personally am not strongly opinionated as long as the code stays uniform when multiple people contribute.

zaneli commented 8 years ago

I see. Thank you so much!