-
Notifications
You must be signed in to change notification settings - Fork 148
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
Improved alignParameters
handling should be opt-in
#206
Comments
Should this be milestone 1.0, @sschaef / @fommil ? It's an improvement to an existing opt-in feature, but I notice that @jrudolph disabled |
To visualize what I'm talking about, here's an example from akka: diff --git a/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala b/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala
index 1139fc1..e0ba2b1 100644
--- a/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala
+++ b/akka-actor/src/main/scala/akka/routing/ConsistentHashing.scala
@@ -135,9 +135,9 @@ object ConsistentHashingRoutingLogic {
*/
@SerialVersionUID(1L)
final case class ConsistentHashingRoutingLogic(
- system: ActorSystem,
- virtualNodesFactor: Int = 0,
- hashMapping: ConsistentHashingRouter.ConsistentHashMapping = ConsistentHashingRouter.emptyConsistentHashMapping)
+ system: ActorSystem,
+ virtualNodesFactor: Int = 0,
+ hashMapping: ConsistentHashingRouter.ConsistentHashMapping = ConsistentHashingRouter.emptyConsistentHashMapping)
extends RoutingLogic {
import ConsistentHashingRouter._ Note that the types are aligned as are the default values. This is a new addition to the |
I really like alignment but haven't used it yet. |
It's more that you can no longer opt-in to formatting like: // Int is not aligned with String.
def foo(arg1: Int,
arg2HasALongName: String): Unit This is the kind of alignment that v0.1.4 does. Akka disabled |
😄 wow, we're actually getting near 1.0 |
I tried your branch with def validate[T1, T2](value1: RequestVal[T1],
- value2: RequestVal[T2],
- check: Function2[T1, T2, JBoolean],
- errorMsg: String,
- innerRoute: Route, moreInnerRoutes: Route*): Route =
+ value2: RequestVal[T2],
+ check: Function2[T1, T2, JBoolean],
+ errorMsg: String,
+ innerRoute: Route, moreInnerRoutes: Route*): Route = So, the first line is now preserved but the indentation of the others still changes. |
@jrudolph - It looks like you left the |
Setting it to - def validate[T1, T2](value1: RequestVal[T1],
- value2: RequestVal[T2],
- check: Function2[T1, T2, JBoolean],
- errorMsg: String,
+ def validate[T1, T2](value1: RequestVal[T1],
+ value2: RequestVal[T2],
+ check: Function2[T1, T2, JBoolean],
+ errorMsg: String, |
Precisely. That's what this bug intends to address: The additional alignment of the types & default values in method signatures should be behind a preference, instead of the default behavior of So, it sounds like this should be milestone 1.0 - @fommil / @sschaef ? I'd tag it myself, but I don't have permissions. :) |
we should probably get you added |
FYI https://github.com/jkinkead/scalariform/tree/align_parameter_types_tmp has a fix. It's very simple, but it's dependent on #205 . |
@jkinkead thanks, makes sense. If I get to it I'll try your branch. |
Cool, your new switch works nicely. What's now left over for Akka is
|
Awesome, that list aligns with my observations as well. :)
|
alignParameters
handling was expanded in thedaniel-trinh
fork to include aligning equals signs and default values.This should possibly be hidden behind an option per #142 .
The text was updated successfully, but these errors were encountered: