Skip to content

Commit

Permalink
Enable top level statement blank lines scalafmt rule, which adds a bl…
Browse files Browse the repository at this point in the history
…ank line after imports (digital-asset#11180)

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
nicu-da authored Oct 11, 2021
1 parent 7e2edbd commit 9b2a8c7
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ runner.fatalWarnings = true
trailingCommas = multiple
# Disable scala doc wrapping (behavior changed in v3.0.0).
docstrings.wrap = no
newlines.topLevelStatementBlankLines = [
{ blanks { after = 1 }, regex = "^Import" }
]
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class CommandPreprocessorSpec

import com.daml.lf.testing.parser.Implicits._
import com.daml.lf.transaction.test.TransactionBuilder.Implicits.{defaultPackageId => _, _}

private implicit val defaultPackageId = defaultParserParameters.defaultPackageId

private[this] val pkg =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class ValueTranslatorSpec
import Preprocessor.ArrayList
import com.daml.lf.testing.parser.Implicits._
import com.daml.lf.transaction.test.TransactionBuilder.Implicits.{defaultPackageId => _, _}

private[this] implicit val defaultPackageId: Ref.PackageId =
defaultParserParameters.defaultPackageId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ private[lf] object Pretty {

import com.daml.lf.language.Ast._
import com.daml.lf.speedy.SExpr._

def prettyAlt(index: Int)(alt: SCaseAlt): Doc = {
val (pat, newIndex) = alt.pattern match {
case SCPNil => (text("nil"), index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class SpeedyTest extends AnyWordSpec with Matchers {

import SpeedyTest._
import defaultParserParameters.{defaultPackageId => pkgId}

def qualify(name: String) = Identifier(pkgId, QualifiedName.assertFromString(name))

val pkgs = typeAndCompile(p"")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ object TypedValueGenerators {

import Value._, ValueGenerators.Implicits._, data.Utf8.ImplicitOrder._
import scalaz.std.anyVal._

val text = noCid(PT.Text, ValueText) { case ValueText(t) => t }
val int64 = noCid(PT.Int64, ValueInt64) { case ValueInt64(i) => i }
val unit = noCid(PT.Unit, (_: Unit) => ValueUnit) { case ValueUnit => () }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ object UsedTypeParams {

import VarianceConstraint.BaseResolution
import Variance._

private[this] type TVar = Ref.Name

final class ResolvedVariance private (private val prior: Map[Identifier, ImmArraySeq[Variance]]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ContractDaoTest
object ContractDaoTest {
import org.scalacheck.Arbitrary, Arbitrary.arbitrary
import ContractDao.Lagginess

implicit def `arb Lagginess`[TpId: Arbitrary, Off: Arbitrary]: Arbitrary[Lagginess[TpId, Off]] =
Arbitrary(arbitrary[(Set[TpId], Set[TpId], Off)].map((Lagginess[TpId, Off] _).tupled))
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import scala.util.{Failure, Success, Try}
class Server(config: Config) extends StrictLogging {
import com.daml.auth.middleware.api.JsonProtocol._
import com.daml.auth.oauth2.api.JsonProtocol._

implicit private val unmarshal: Unmarshaller[String, Uri] = Unmarshaller.strict(Uri(_))

private def toRedirectUri(uri: Uri) =
Expand Down

0 comments on commit 9b2a8c7

Please sign in to comment.