Skip to content

Commit

Permalink
Apply avoidEmptyLinesAroundBlock to existing tests
Browse files Browse the repository at this point in the history
Since newlines.avoidEmptyLinesAroundBlock on by default,
existing tests should take it into account
  • Loading branch information
tdidriksen committed Oct 25, 2019
1 parent 4fa0c27 commit 71895e1
Show file tree
Hide file tree
Showing 20 changed files with 0 additions and 41 deletions.
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/default/Advanced.stat
Expand Up @@ -223,7 +223,6 @@ callStatement = js.If(genIsInstanceOf(callTrg, rtClass.tpe), {
rawApply
} else {
val reflBoxClassPatched = {

def isIntOrLongKind(kind: TypeKind) = kind match {
case _: INT | LONG => true
case _ => false
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/default/Apply.stat
Expand Up @@ -249,7 +249,6 @@ class ResolutionCopier(x: Int) {
}
>>>
class ResolutionCopier(x: Int) {

def visitClassDeclaration(node: ClassDeclaration): Boolean = {
val toNode = this._toNode.asInstanceOf[ClassDeclaration];
javaBooleanAnd(
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/default/Class.stat
Expand Up @@ -62,7 +62,6 @@ class MediaStream() extends EventTarget {
}
>>>
class MediaStream() extends EventTarget {

/**
*/
val ended: Boolean = js.native
Expand Down
5 changes: 0 additions & 5 deletions scalafmt-tests/src/test/resources/default/Comment.stat
Expand Up @@ -10,7 +10,6 @@
}
>>>
{

def cancel(reason: Any): js.Promise[Any] = js.native // comment

/**
Expand All @@ -29,7 +28,6 @@ object KeyValue {
}
>>>
object KeyValue {

// ================================
// 6.3.1 Special Key Values

Expand All @@ -45,7 +43,6 @@ object KeyValue {
}
>>>
object KeyValue {

// comment
/** This key value */
final val Unidentified = "Unidentified"
Expand Down Expand Up @@ -74,7 +71,6 @@ object D {
}
>>>
object D {

private val decompressedPrefixes: Seq[(String, String)] =
compressedPrefixes map { case (a, b) => (b, a) }

Expand All @@ -94,7 +90,6 @@ object Primes {
}
>>>
object Primes {

// prime sieve; use instead of the test or stream when you know the
// upper bound of the primes you will need.
// en.wikipedia.org/wiki/Sieve_of_Eratosthenes
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/default/DefDef.stat
Expand Up @@ -9,7 +9,6 @@ object a {
}
>>>
object a {

/**
* Returns True is this state will always return better formatting than other.
*/
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/default/Fidelity.source
Expand Up @@ -10,7 +10,6 @@ object ScalaJSGroupID {
}
>>>
object ScalaJSGroupID {

def auto_impl(c: Context { type PrefixType = ScalaJSGroupID })()
: Expr[CrossGroupArtifactID] = {
reify {}
Expand Down
4 changes: 0 additions & 4 deletions scalafmt-tests/src/test/resources/default/Idempotency.stat
Expand Up @@ -86,7 +86,6 @@ val bindingFuture = Http().bindAndHandleSync({
>>>
{
{

{
{
{
Expand All @@ -103,7 +102,6 @@ val bindingFuture = Http().bindAndHandleSync({
}
}
}

}
<<< rendering #339
{{
Expand All @@ -130,7 +128,6 @@ val bindingFuture = Http().bindAndHandleSync({
RequestRenderingContext(request, hostHeader, sendEntityTrigger)
}
}

})
}
}
Expand Down Expand Up @@ -169,7 +166,6 @@ val bindingFuture = Http().bindAndHandleSync({
})
new ResponseParsingMerge(rootParser)
}

})
}
}
Expand Down
Expand Up @@ -132,7 +132,6 @@ object A {
}
>>>
object A {

/** test */
def foo(): Int = 0
// bar
Expand Down
Expand Up @@ -15,14 +15,12 @@ object a {
}
>>>
object a {

val x: Int => String = {
case 2 =>
"two"
case _ =>
"other"
}

}
<<< case clauses with stuff
object a {
Expand All @@ -41,7 +39,6 @@ object a {
}
>>>
object a {

val x: Int => String = {
case 2 =>
println("TWO")
Expand All @@ -50,7 +47,6 @@ object a {
// Nice
"other"
}

}
<<< case clauses to unit
object a {
Expand All @@ -66,12 +62,10 @@ object a {
}
>>>
object a {

val x: Int => Unit = {
case 0 =>
case 1 =>
case 2 =>
case _ => println("?")
}

}
Expand Up @@ -15,15 +15,13 @@ object a {
}
>>>
object a {

def x(i: Int): String =
if (i == 0)
"zero"
else if (i < 0)
"sub-zero"
else
"other"

}
<<< if-else with stuff
object a {
Expand All @@ -50,7 +48,6 @@ object a {
}
>>>
object a {

def x(i: Int): String =
if (i == 0)
/* what */
Expand Down Expand Up @@ -88,7 +85,6 @@ object a {
}
>>>
object a {

val x: Int => Unit =
if (i == 0)
println("zero")
Expand All @@ -98,7 +94,6 @@ object a {
def y(i: Int) =
if (i > 0)
println("yes!")

}
<<< nested if
object a {
Expand Down
Expand Up @@ -32,7 +32,6 @@ private[test] sealed trait Test {
}

private[test] final object Tests {

protected[Tests] final case object Test1 extends Test {
final implicit override lazy val name: String = "foo"
}
Expand Down Expand Up @@ -66,7 +65,6 @@ private[test] sealed trait Test {
}

private[test] final object Tests {

protected[Tests] final case object Test1 extends Test {
final implicit override lazy val name: String = "foo"
}
Expand Down
Expand Up @@ -34,7 +34,6 @@ sealed private[test] trait Test {
}

final private[test] object Tests {

final private type T1 = Int
final private type T2 = String

Expand Down Expand Up @@ -78,7 +77,6 @@ sealed private[test] trait Test {
}

final private[test] object Tests {

final private type T1 = Int
final private type T2 = String

Expand Down
Expand Up @@ -32,7 +32,6 @@ private[test] sealed trait Test {
}

private[test] final object Tests {

protected[Tests] final case object Test1 extends Test {
final implicit override lazy val name: String = "foo"
}
Expand Down
Expand Up @@ -13,11 +13,9 @@ object Hase {
import play.api.libs.json.{ JsObject, JsString, Json }

object Hase {

def name(xs: OtherObject): String = {
s"Hallo ${xs.name}"
}

}
<<< import
import a.b.{c => d}
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/test/JavaDoc.stat
Expand Up @@ -8,7 +8,6 @@ val y = 2
}
>>>
object a {

/**
* Y is cool
*/
Expand Down
2 changes: 0 additions & 2 deletions scalafmt-tests/src/test/resources/test/i1439.stat
Expand Up @@ -10,12 +10,10 @@ bar should endWith("st")
}
>>>
class TestSpec extends FlatSpec with Matchers {

"Foo" should "do things" in {
def bar: String = "test"
bar should endWith("st")
}

}
<<< test
object test {
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/unit/Advanced.source
Expand Up @@ -28,7 +28,6 @@
x + y
})
object a extends b with c {

def foo[T: Int#Double#Triple,
R <% String](
@annot1
Expand Down
2 changes: 0 additions & 2 deletions scalafmt-tests/src/test/resources/unit/Basic.source
Expand Up @@ -7,7 +7,6 @@ object a {
def two = 2 }
>>>
object a {

def one = 1

def two = 2
Expand All @@ -24,7 +23,6 @@ object a {
def two = 2 }
>>>
object a {

/**
* One
*/
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/unit/ColumnWidth.source
Expand Up @@ -46,7 +46,6 @@ object Object {
}
>>>
object Object {

object A { a }
object B_________________________ {
b123456
Expand Down
1 change: 0 additions & 1 deletion scalafmt-tests/src/test/resources/unit/DefDef.stat
Expand Up @@ -119,5 +119,4 @@ def heyImCool = {
>>>
def heyImCool = {
val c = b.foobar

}

0 comments on commit 71895e1

Please sign in to comment.