Replace silencer plugin with built-in warning configuration (#12543)

Since Scala 2.13.2, Scala introduced built-in support to
manage warnings in a more granular fashion, thus making
the silencer plugin we are currently using no longer
strictly useful. Removing compiler plugins also removes
friction from migrating to Scala 3 in the future. As a
cherry on top, the built-in warning configuration also
allows to check whether a `@nowarn` actually does
anything, allowing us to proactively remove unused
warnings should the need arise.

[Here][1] is s a blog post by the Scala team about it.

Warnings have been either solved or preserved if useful,
trying to minimize the scope (keeping it at the single
expression scope if possible). In particular, all
remaining usages of the Scala Collection API compatibility
module have been removed.

Using the silencer plugin also apparently hid a few
remaining usages of compatibility libraries that were used
as part of the transition from Scala 2.12 to Scala 2.13
that are no longer needed. Removing those warnings
highlighted those.

changelog_begin
changelog_end

[1]: https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html
This commit is contained in:
Stefano Baghino 2022-01-24 16:01:35 +01:00 committed by GitHub
parent 93cfe043f8
commit aec3390904
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
122 changed files with 58 additions and 455 deletions

View File

@ -39,28 +39,9 @@ def resolve_scala_deps(deps, scala_deps = [], versioned_deps = {}, versioned_sca
versioned_scala_deps.get(scala_major_version, [])
]
def extra_scalacopts(scala_deps, plugins):
return (["-P:silencer:lineContentFilters=import scala.collection.compat._"] if (scala_major_version != "2.12" and
silencer_plugin in plugins and
"@maven//:org_scala_lang_modules_scala_collection_compat" in scala_deps) else [])
# Please don't remove, this will be useful in the future to transition to Scala 3
version_specific = {
"2.12": [
# these two flags turn on source-incompatible enhancements that are always
# on in Scala 2.13. Despite the naming, though, the most impactful and
# 2.13-like change is -Ypartial-unification. -Xsource:2.13 only turns on
# some minor, but in one specific case (scala/bug#10283) essential bug fixes
"-Xsource:2.13",
"-Ypartial-unification",
# adapted args is a deprecated feature:
# `def foo(a: (A, B))` can be called with `foo(a, b)`.
# properly it should be `foo((a,b))`
"-Yno-adapted-args",
"-Xlint:unsound-match",
"-Xlint:by-name-right-associative", # will never be by-name if used correctly
"-Xfuture",
"-language:higherKinds",
],
"2.13": [],
}
common_scalacopts = version_specific.get(scala_major_version, []) + [
@ -96,8 +77,7 @@ common_scalacopts = version_specific.get(scala_major_version, []) + [
# Gives a warning for functions declared as returning Unit, but the body returns a value
"-Ywarn-value-discard",
"-Ywarn-unused:imports",
# Allow `@nowarn` annotations that allegedly do nothing (necessary because of false positives)
"-Ywarn-unused:-nowarn",
"-Ywarn-unused:nowarn",
"-Ywarn-unused",
]
@ -109,12 +89,9 @@ common_plugins = [
"@maven//:org_wartremover_wartremover_{}".format(scala_version_suffix),
]
# Please don't remove, this will be useful in the future to transition to Scala 3
version_specific_warts = {
"2.12": [
# On 2.13, this also triggers in string interpolation
# https://github.com/wartremover/wartremover/issues/447
"StringPlusAny",
],
"2.13": [],
}
plugin_scalacopts = [
@ -233,10 +210,9 @@ def _wrap_rule(
exports = resolve_scala_deps(exports, scala_exports)
if (len(exports) > 0):
kwargs["exports"] = exports
compat_scalacopts = extra_scalacopts(scala_deps = scala_deps, plugins = plugins)
rule(
name = name,
scalacopts = common_scalacopts + plugin_scalacopts + compat_scalacopts + scalacopts,
scalacopts = common_scalacopts + plugin_scalacopts + scalacopts,
plugins = common_plugins + plugins,
deps = deps,
runtime_deps = runtime_deps,
@ -542,12 +518,11 @@ def _create_scaladoc_jar(
# Limit execution to Linux and MacOS
if is_windows == False:
deps = resolve_scala_deps(deps, scala_deps, versioned_deps, versioned_scala_deps)
compat_scalacopts = extra_scalacopts(scala_deps = scala_deps, plugins = plugins)
scaladoc_jar(
name = name + "_scaladoc",
deps = deps,
srcs = srcs,
scalacopts = common_scalacopts + plugin_scalacopts + compat_scalacopts + scalacopts,
scalacopts = common_scalacopts + plugin_scalacopts + scalacopts,
plugins = common_plugins + plugins,
generated_srcs = generated_srcs,
tags = ["scaladoc"],

View File

@ -1,7 +1,7 @@
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
load("//bazel_tools:scala.bzl", "da_scala_binary", "silencer_plugin")
load("//bazel_tools:scala.bzl", "da_scala_binary")
genrule(
name = "scenario_service_jar",
@ -15,12 +15,8 @@ da_scala_binary(
name = "scenario-service-raw",
srcs = glob(["src/main/scala/**/*.scala"]),
main_class = "com.daml.lf.scenario.ScenarioServiceMain",
plugins = [
silencer_plugin,
],
resources = glob(["src/main/resources/*"]),
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:org_scalaz_scalaz_core",
"@maven//:com_github_scopt_scopt",

View File

@ -22,7 +22,6 @@ import com.daml.lf.engine.script.{Participants, Runner, Script, ScriptF, ScriptI
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import scala.collection.compat._
import scala.collection.immutable.HashMap
import scala.util.{Failure, Success}

View File

@ -12,7 +12,6 @@ load(
"da_scala_test_suite",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
load("//daml-lf/language:daml-lf.bzl", "LF_MAJOR_VERSIONS", "PROTO_LF_VERSIONS", "mangle_for_java", "versions")
load(
@ -96,12 +95,8 @@ da_haskell_library(
da_scala_library(
name = "daml_lf_archive_reader",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = lf_scalacopts_stricter,
tags = ["maven_coordinates=com.daml:daml-lf-archive-reader:__VERSION__"],

View File

@ -16,7 +16,6 @@ import com.daml.nameof.NameOf
import com.daml.scalautil.Statement.discard
import scala.Ordering.Implicits.infixOrderingOps
import scala.collection.compat._
import scala.collection.mutable
import scala.jdk.CollectionConverters._

View File

@ -8,7 +8,6 @@ load(
"kind_projector_plugin",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
da_scala_library(
@ -17,14 +16,11 @@ da_scala_library(
glob(["src/main/scala/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
],
scalacopts = lf_scalacopts_stricter + [
"-P:silencer:lineContentFilters=import ImmArraySeq.Implicits._",
],
scalacopts = lf_scalacopts_stricter,
tags = ["maven_coordinates=com.daml:daml-lf-data:__VERSION__"],
visibility = [
"//visibility:public",
@ -41,20 +37,13 @@ da_scala_library(
da_scala_test(
name = "data-test",
size = "small",
srcs = glob(["src/test/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatestplus_scalacheck_1_15",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scalaz_scalaz_scalacheck_binding",
],
scalacopts = lf_scalacopts + [
"-P:silencer:lineContentFilters=import ImmArraySeq.Implicits._",
"-P:silencer:lineContentFilters=signum",
],
scalacopts = lf_scalacopts,
deps = [
":data",
"//daml-lf/data-scalacheck",

View File

@ -7,18 +7,13 @@ load(
"da_scala_test",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
da_scala_library(
name = "interface",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = lf_scalacopts_stricter,
tags = ["maven_coordinates=com.daml:daml-lf-interface:__VERSION__"],

View File

@ -7,7 +7,6 @@ package reader
import com.daml.lf.data.Ref.{DottedName, Name}
import scala.language.implicitConversions
import scala.collection.compat._
import scala.collection.immutable.Map
import scalaz.{-\/, ==>>, @@, Applicative, Cord, Monoid, Order, Semigroup, Tag, Traverse, \/, \/-}
import scalaz.std.map._

View File

@ -7,7 +7,6 @@ load(
"da_scala_test",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
da_scala_library(
@ -29,12 +28,7 @@ da_scala_test(
name = "language-test",
size = "small",
srcs = glob(["src/test/**/*.scala"]),
plugins = [
silencer_plugin,
],
scalacopts = lf_scalacopts + [
"-P:silencer:lineContentFilters=signum",
],
scalacopts = lf_scalacopts,
deps = [
":language",
"//daml-lf/data",

View File

@ -27,7 +27,7 @@ class LanguageVersionSpec extends AnyWordSpec with Matchers with TableDrivenProp
forEvery(versions)(v2 =>
LV.Ordering
.compare(v1, v2)
.signum shouldBe (versionRank(v1) compareTo versionRank(v2)).signum
.sign shouldBe (versionRank(v1) compareTo versionRank(v2)).sign
)
)
}

View File

@ -7,22 +7,16 @@ load(
"da_scala_test",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
da_scala_library(
name = "parser",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scala_lang_modules_scala_parser_combinators",
"@maven//:org_scalaz_scalaz_core",
],
scalacopts = lf_scalacopts_stricter + [
"-P:silencer:lineContentFilters=standardInterpolator",
],
scalacopts = lf_scalacopts_stricter,
visibility = [
"//daml-lf:__subpackages__",
"//ledger:__subpackages__",

View File

@ -31,11 +31,16 @@ object Implicits {
@SuppressWarnings(Array("org.wartremover.warts.Any"))
def n(args: Any*): Ref.Name =
Ref.Name.assertFromString(sc.standardInterpolator(identity, args.map(prettyPrint)))
Ref.Name.assertFromString(
StringContext.standardInterpolator(identity, args.map(prettyPrint), sc.parts)
)
@SuppressWarnings(Array("org.wartremover.warts.Any"))
private def interpolate[T](p: Parsers.Parser[T])(args: Seq[Any]): T =
Parsers.parseAll(Parsers.phrase(p), sc.standardInterpolator(identity, args.map(prettyPrint)))
Parsers.parseAll(
Parsers.phrase(p),
StringContext.standardInterpolator(identity, args.map(prettyPrint), sc.parts),
)
}
private def toString(x: BigDecimal) =

View File

@ -6,7 +6,6 @@ load(
"da_scala_library",
"kind_projector_plugin",
"lf_scalacopts_stricter",
"silencer_plugin",
)
da_scala_library(
@ -14,7 +13,6 @@ da_scala_library(
srcs = glob(["src/main/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
@ -23,11 +21,7 @@ da_scala_library(
"@maven//:org_scalaz_scalaz_scalacheck_binding",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = lf_scalacopts_stricter + [
"-P:silencer:lineContentFilters=import elt.injshrink",
# Forced upon us by Shrink
"-P:silencer:lineContentFilters=Stream.empty",
],
scalacopts = lf_scalacopts_stricter,
tags = ["maven_coordinates=com.daml:daml-lf-transaction-test-lib:__VERSION__"],
visibility = ["//visibility:public"],
deps = [

View File

@ -147,7 +147,6 @@ object TypedValueGenerators {
Tag unsubst implicitly[Arbitrary[Vector[elt.Inj] @@ Div3]]
}
override def injshrink(implicit shr: Shrink[Value.ContractId]) = {
import elt.injshrink
implicitly[Shrink[Vector[elt.Inj]]]
}
}
@ -169,7 +168,6 @@ object TypedValueGenerators {
implicitly[Arbitrary[Option[elt.Inj]]]
}
override def injshrink(implicit cid: Shrink[Value.ContractId]) = {
import elt.injshrink
implicitly[Shrink[Option[elt.Inj]]]
}
}
@ -306,7 +304,7 @@ object TypedValueGenerators {
override def injshrink(implicit shr: Shrink[Value.ContractId]) =
Shrink { ev =>
if (!(values.headOption contains ev)) values.headOption.toStream
else Stream.empty
else Stream.empty: @annotation.nowarn("cat=deprecation")
}
},
)

View File

@ -8,7 +8,6 @@ load(
"da_scala_test",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
#
@ -47,12 +46,8 @@ proto_jars(
da_scala_library(
name = "transaction",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = lf_scalacopts_stricter,
tags = ["maven_coordinates=com.daml:daml-lf-transaction:__VERSION__"],
@ -77,16 +72,12 @@ da_scala_test(
"src/test/**/value/*.scala",
"src/test/**/transaction/*.scala",
]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatestplus_scalacheck_1_15",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scalaz_scalaz_scalacheck_binding",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = lf_scalacopts,
deps = [
@ -107,9 +98,6 @@ da_scala_test(
srcs = glob([
"src/test/**/validation/*.scala",
]),
plugins = [
silencer_plugin,
],
scalacopts = lf_scalacopts,
deps = [
":transaction",

View File

@ -3,7 +3,7 @@
package com.daml.lf
import scala.collection.compat._
import scala.collection.BuildFrom
package object transaction {

View File

@ -14,12 +14,10 @@ import shapeless.record.{Record => HRecord}
import shapeless.syntax.singleton._
import shapeless.{Coproduct => HSum}
import scala.annotation.nowarn
import scala.language.implicitConversions
class HashSpec extends AnyWordSpec with Matchers {
@nowarn("msg=dead code following this construct")
private val packageId0 = Ref.PackageId.assertFromString("package")
private val complexRecordT =

View File

@ -18,7 +18,6 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import scala.collection.compat._
import scala.Ordering.Implicits.infixOrderingOps
import scala.jdk.CollectionConverters._

View File

@ -8,7 +8,6 @@ load(
"da_scala_test",
"lf_scalacopts",
"lf_scalacopts_stricter",
"silencer_plugin",
)
da_scala_library(
@ -36,12 +35,7 @@ da_scala_test(
name = "validation-test",
size = "small",
srcs = glob(["src/test/**/*.scala"]),
plugins = [
silencer_plugin,
],
scalacopts = lf_scalacopts + [
"-P:silencer:lineContentFilters=standardInterpolator",
],
scalacopts = lf_scalacopts,
deps = [
":validation",
"//daml-lf/data",

View File

@ -38,9 +38,12 @@ private[validation] object SpecUtil {
)
implicit class SyntaxHelper2(val sc: StringContext) extends AnyVal {
def K(args: Any*): Kind = k"${replace(sc.standardInterpolator(identity, args))}"
def T(args: Any*): Type = t"${replace(sc.standardInterpolator(identity, args))}"
def E(args: Any*): Expr = e"${replace(sc.standardInterpolator(identity, args))}"
def K(args: Any*): Kind =
k"${replace(StringContext.standardInterpolator(identity, args, sc.parts))}"
def T(args: Any*): Type =
t"${replace(StringContext.standardInterpolator(identity, args, sc.parts))}"
def E(args: Any*): Expr =
e"${replace(StringContext.standardInterpolator(identity, args, sc.parts))}"
def replace(s: String): String = {
val b = new StringBuilder()

View File

@ -14,7 +14,6 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_test",
"silencer_plugin",
)
exports_files(["src/main/resources/logback.xml"])
@ -23,15 +22,11 @@ da_scala_binary(
name = "export",
srcs = glob(["src/main/scala/**/*.scala"]),
main_class = "com.daml.script.export.Main",
plugins = [
silencer_plugin,
],
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_typelevel_paiges_core",
"@maven//:io_circe_circe_core",
@ -76,6 +71,5 @@ da_scala_test(
"//language-support/scala/bindings",
"//ledger/ledger-api-common",
"//libs-scala/auth-utils",
"@maven//:org_scalatest_scalatest_compatible",
],
)

View File

@ -20,7 +20,6 @@ import scalaz.std.iterable._
import scalaz.std.set._
import scalaz.syntax.foldable._
import scala.collection.compat._
import scala.collection.mutable
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

View File

@ -5,7 +5,6 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"silencer_plugin",
)
load("//bazel_tools:proto.bzl", "proto_gen")
load("//bazel_tools:java.bzl", "da_java_library")
@ -107,9 +106,6 @@ da_scala_test_suite(
"src/test/**/*Spec.scala",
"src/test/**/*Test.scala",
]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatest_scalatest_core",
@ -117,11 +113,6 @@ da_scala_test_suite(
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
"@maven//:org_scalatestplus_scalacheck_1_15",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = [
"-P:silencer:globalFilters=DeduplicationTime.*deprecated", # deprecated field that needs to be tested
"-P:silencer:globalFilters=DEDUPLICATION_TIME.*deprecated", # deprecated field that needs to be tested
],
deps = [
":bindings-java",

View File

@ -13,6 +13,8 @@ import org.scalatest.matchers.should.Matchers
import scala.jdk.CollectionConverters._
// Allows using deprecated Protobuf fields for testing
@annotation.nowarn("cat=deprecation&origin=com\\.daml\\.ledger\\.api\\.v1\\..*")
final class SubmitCommandsRequestSpec extends AnyFlatSpec with Matchers {
behavior of "SubmitCommandsRequest.toProto/fromProto"

View File

@ -14,7 +14,6 @@ import org.scalatest.prop.TableDrivenPropertyChecks
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalatest.matchers.should.Matchers
import org.scalatest.flatspec.AnyFlatSpec
import scala.collection.compat._
class ValueSpec
extends AnyFlatSpec

View File

@ -8,7 +8,6 @@ load(
"da_scala_test",
"scala_source_jar",
"scaladoc_jar",
"silencer_plugin",
)
load(
"//rules_daml:daml.bzl",
@ -43,9 +42,6 @@ da_scala_binary(
da_scala_library(
name = "lib",
srcs = glob(["src/main/**/*.scala"]),
plugins = [
silencer_plugin,
],
resources = [
"src/main/resources/logback.xml",
],
@ -53,7 +49,6 @@ da_scala_library(
"@maven//:com_github_scopt_scopt",
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
tags = ["maven_coordinates=com.daml:codegen-java-lib:__VERSION__"],
visibility = ["//visibility:public"],

View File

@ -10,7 +10,6 @@ import com.typesafe.scalalogging.StrictLogging
import scala.annotation.tailrec
import scala.collection.mutable
import scala.concurrent.{ExecutionContext, Future}
import scala.collection.compat._
import scala.jdk.CollectionConverters._
private[codegen] sealed trait Node

View File

@ -6,7 +6,6 @@ load(
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
da_scala_library(
@ -14,7 +13,6 @@ da_scala_library(
srcs = glob(["src/main/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
@ -24,7 +22,6 @@ da_scala_library(
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
],
scala_exports = [

View File

@ -17,7 +17,6 @@ import scalaz.std.either._
import scalaz.std.list._
import scalaz.syntax.traverse._
import scala.collection.compat._
import scala.collection.immutable
object DomainTransactionMapper {

View File

@ -6,7 +6,6 @@ load(
"da_scala_library",
"da_scala_test",
"kind_projector_plugin",
"silencer_plugin",
)
load(
"//rules_daml:daml.bzl",
@ -46,22 +45,14 @@ da_scala_library(
srcs = [":MyMain.srcjar"] + glob(["src/main/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = [
"-P:silencer:checkUnused",
# codegen eliminates the vast majority of potential unused warnings. For example,
# it checks whether tparams are phantom or not and requires evidence only if they
# are not. It misses the case where a tparam is used in ContractId position, which
# is essentially phantom for the typeclasses. The fix requires recurring into
# referenced types, and only occurs here in this source tree, so I don't consider
# it worth fixing for now. -SC
"-P:silencer:lineContentFilters=ContractIdNT (Value|LfEncodable).*?implicit .?ev",
"-P:silencer:lineContentFilters=import _root_.scala.language.higherKinds;",
"-Wconf:cat=unused-imports&site=com\\.daml\\.sample\\..*:s",
"-Wconf:msg=parameter value ev.. in method ContractIdNT (Value)|(LfEncodable) is never used:s",
],
visibility = [
"//visibility:public",

View File

@ -6,7 +6,6 @@ load(
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version")
@ -15,18 +14,12 @@ da_scala_library(
srcs = glob(["src/main/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scalaz_scalaz_scalacheck_binding",
],
scalacopts = [
# Forced upon us by scalatest
"-P:silencer:lineContentFilters=Stream",
],
visibility = [
"//visibility:public",
],
@ -86,9 +79,6 @@ da_scala_test_suite(
],
exclude = testing_utils,
) + glob(["src/test/{}/scala/**/*.scala".format(scala_major_version)]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:org_scalacheck_scalacheck",
@ -97,7 +87,6 @@ da_scala_test_suite(
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
"@maven//:org_scalatestplus_scalacheck_1_15",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
],
deps = [

View File

@ -5,8 +5,6 @@ package com.daml.ledger.client.binding.encoding
import java.time.{LocalDate, ZoneOffset}
import com.daml.api.util.TimestampConversion
import com.daml.ledger.client.binding.{Primitive => P}
import scalaz.std.stream
object DamlDates {
val Min: LocalDate = TimestampConversion.MIN.atZone(ZoneOffset.UTC).toLocalDate
@ -32,20 +30,4 @@ object DamlDates {
*/
val RangeOfLocalDatesWithoutInjectiveFunctionToSqlDate: (LocalDate, LocalDate) =
(LocalDate.parse("1582-10-05"), LocalDate.parse("1582-10-14"))
def localDatesWithoutInjectiveFunctionToSqlDate: Stream[LocalDate] =
stream
.unfold(RangeOfLocalDatesWithoutInjectiveFunctionToSqlDate._1) { a: LocalDate =>
if (!a.isAfter(RangeOfLocalDatesWithoutInjectiveFunctionToSqlDate._2))
Some((a, a.plusDays(1)))
else None
}
def damlDatesWithoutInjectiveFunctionToSqlDate: Stream[P.Date] =
localDatesWithoutInjectiveFunctionToSqlDate.map(pDate)
private def pDate(d: LocalDate): P.Date =
P.Date
.fromLocalDate(d)
.getOrElse(sys.error(s"expected `P.Date` friendly `LocalDate`, but got: $d"))
}

View File

@ -44,6 +44,7 @@ abstract class ShrinkEncoding extends LfTypeEncoding {
override def variant[A](variantId: rpcvalue.Identifier, cases: VariantCases[A]): Out[A] = cases
@annotation.nowarn("cat=deprecation&origin=scala\\.Stream")
override def enumAll[A](
enumId: Identifier,
index: A => Int,
@ -53,6 +54,7 @@ abstract class ShrinkEncoding extends LfTypeEncoding {
if (index(a) == 0) Stream.empty else Stream(cases.head._2)
}
@annotation.nowarn("cat=deprecation&origin=scala\\.Stream")
override def variantCase[B, A](caseName: String, o: Out[B])(
inject: B => A
)(select: A PartialFunction B): VariantCases[A] = Shrink[A] { a: A =>
@ -98,6 +100,7 @@ object ShrinkEncoding extends ShrinkEncoding {
override val valueText: Out[P.Text] = myShrinkString
@annotation.nowarn("cat=deprecation&origin=scala\\.Stream")
private def myShrinkString: Shrink[String] = Shrink { s0: String =>
import scalaz.std.stream.unfold

View File

@ -7,7 +7,6 @@ import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import scala.annotation.nowarn
import scala.collection.compat._
import scala.collection.immutable.Map
class Primitive213Spec extends AnyWordSpec with Matchers {

View File

@ -13,7 +13,6 @@ import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import shapeless.test.illTyped
import scala.annotation.nowarn
import scala.collection.compat._
import scala.collection.immutable.Map
class PrimitiveSpec extends AnyWordSpec with Matchers with ScalaCheckDrivenPropertyChecks {

View File

@ -7,7 +7,6 @@ load(
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
common_scalacopts = [
@ -28,12 +27,10 @@ da_scala_library(
),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = common_scalacopts,
tags = ["maven_coordinates=com.daml:codegen-scala:__VERSION__"],
@ -85,9 +82,6 @@ da_scala_test_suite(
name = "tests",
size = "small",
srcs = glob(["src/test/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",

View File

@ -27,7 +27,6 @@ import scalaz.syntax.std.option._
import scalaz.syntax.bind._
import scalaz.syntax.traverse1._
import scala.collection.compat._
import scala.util.matching.Regex
object CodeGen {

View File

@ -11,7 +11,6 @@ import com.daml.lf.data.ImmArray.ImmArraySeq
import java.io.File
import scala.collection.compat._
import scala.reflect.runtime.universe._
import scalaz.{Tree => _, _}
import scalaz.std.list._

View File

@ -13,8 +13,6 @@ import scalaz.syntax.bifoldable._
import scalaz.syntax.foldable._
import scalaz.Bifoldable
import scala.collection.compat._
sealed abstract class DependencyGraph[Iface, TmplI] {
def orderedDependencies(
library: Iface

View File

@ -5,8 +5,6 @@ package com.daml.codegen.dependencygraph
import com.daml.codegen.exception.UnsopportedTypeError
import scala.collection.compat._
object Graph {
/** Orders the nodes such that given a node n, its dependencies are placed in the resultant vector before n

View File

@ -15,8 +15,6 @@ import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import scala.collection.compat._
class UtilTest extends UtilTestHelpers with ScalaCheckDrivenPropertyChecks {
val packageInterface =

View File

@ -5,7 +5,6 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_binary",
"da_scala_library",
"silencer_plugin",
)
load("//rules_daml:daml.bzl", "daml_compile")
load("//language-support/scala/codegen:codegen.bzl", "dar_to_scala")
@ -59,11 +58,8 @@ dar_to_scala(
da_scala_library(
name = "quickstart-scala-codegen-lib",
srcs = [":quickstart-scala-codegen.srcjar"],
plugins = [
silencer_plugin,
],
scalacopts = [
"-P:silencer:lineContentFilters=import _root_.scala.language.higherKinds;",
"-Wconf:cat=unused-imports&site=com\\.daml\\.quickstart\\.iou\\.model..*:s",
],
deps = ["//language-support/scala/bindings"],
)
@ -73,9 +69,6 @@ da_scala_binary(
srcs = glob(["quickstart-scala/application/src/main/scala/**/*.scala"]),
main_class = "com.daml.quickstart.iou.IouMain",
resources = glob(["quickstart-scala/application/src/main/resources/**/*"]),
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
deps = [
":quickstart-scala-codegen-lib",
"//language-support/scala/bindings",

View File

@ -4,21 +4,16 @@
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"silencer_plugin",
)
da_scala_library(
name = "perf-testing",
srcs = glob(["src/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_storm_enroute_scalameter",
"@maven//:com_storm_enroute_scalameter_core",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
visibility = [
"//visibility:public",

View File

@ -11,8 +11,6 @@ import org.scalameter.utils.Tree
import org.scalameter.{CurveData, Parameters}
import org.w3c.dom.{Document, Element}
import scala.collection.compat._
private[reporter] object JMeterXmlGenerator {
private val rootElementName = "testResults"

View File

@ -5,15 +5,11 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"silencer_plugin",
)
da_scala_library(
name = "testing-utils",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
@ -21,7 +17,6 @@ da_scala_library(
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
tags = ["maven_coordinates=com.daml:testing-utils:__VERSION__"],
visibility = [

View File

@ -5,7 +5,6 @@ package com.daml.ledger.api.testing.utils
import org.scalatest.AsyncTestSuite
import scala.collection.compat._
import scala.collection.immutable
trait MultiResourceBase[FixtureId, TestContext]

View File

@ -6,19 +6,14 @@ load(
"da_scala_library",
"da_scala_test",
"lf_scalacopts",
"silencer_plugin",
)
da_scala_library(
name = "db-backend",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_tpolecat_doobie_core",
"@maven//:org_tpolecat_doobie_free",
@ -73,6 +68,5 @@ da_scala_test(
# data = ["//docs:quickstart-model.dar"],
deps = [
":db-backend",
"@maven//:org_scalatest_scalatest_compatible",
],
)

View File

@ -11,7 +11,6 @@ import nonempty.NonEmptyReturningOps._
import doobie._
import doobie.implicits._
import scala.annotation.nowarn
import scala.collection.compat._
import scala.collection.immutable.{Seq => ISeq, SortedMap}
import scalaz.{@@, Cord, Functor, OneAnd, Tag, \/, -\/, \/-}
import scalaz.Digit._0

View File

@ -7,7 +7,6 @@ load(
"da_scala_test",
"kind_projector_plugin",
"lf_scalacopts",
"silencer_plugin",
)
hj_scalacopts = lf_scalacopts + [
@ -19,11 +18,9 @@ da_scala_library(
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_tpolecat_doobie_core",
"@maven//:org_tpolecat_doobie_free",
@ -52,10 +49,8 @@ da_scala_test(
srcs = glob(["src/test/scala/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",

View File

@ -10,7 +10,7 @@ import scalaz.{Semigroup, \/}
import scalaz.std.tuple._
import scalaz.syntax.functor._
import scala.collection.compat._
import scala.collection.Factory
private[daml] sealed abstract class ContractStreamStep[+D, +C] extends Product with Serializable {
import ContractStreamStep._

View File

@ -10,7 +10,7 @@ import com.daml.ledger.api.v1.{event => evv1}
import scalaz.{Monoid, \/, \/-}
import scalaz.syntax.tag._
import scala.collection.compat._
import scala.collection.Factory
import scala.runtime.AbstractFunction1
private[daml] final case class InsertDeleteStep[+D, +C](

View File

@ -4,19 +4,16 @@
load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"silencer_plugin",
)
da_scala_library(
name = "base",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [silencer_plugin],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:com_github_pureconfig_pureconfig_core",
"@maven//:com_github_pureconfig_pureconfig_generic",
"@maven//:com_github_scopt_scopt",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:com_typesafe_scala_logging_scala_logging",

View File

@ -3,8 +3,6 @@
package com.daml.http.dbbackend
import scala.collection.compat._
private[http] sealed trait DbStartupMode
private[http] object DbStartupMode {
private[http] case object CreateOnly extends DbStartupMode

View File

@ -6,7 +6,6 @@ load(
"da_scala_library",
"kind_projector_plugin",
"lf_scalacopts",
"silencer_plugin",
)
hj_scalacopts = lf_scalacopts + [
@ -19,14 +18,12 @@ hj_scalacopts = lf_scalacopts + [
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_http_core",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",

View File

@ -39,7 +39,6 @@ import spray.json.{
enrichString => `sj enrichString`,
}
import scala.collection.compat._
import scala.concurrent.Future
private[http] object WebsocketTestFixture extends StrictLogging with Assertions {

View File

@ -10,7 +10,6 @@ load(
"da_scala_test_suite",
"kind_projector_plugin",
"lf_scalacopts",
"silencer_plugin",
)
load("//rules_daml:daml.bzl", "daml_compile")
load("@os_info//:os_info.bzl", "is_windows")
@ -26,7 +25,6 @@ hj_scalacopts = lf_scalacopts + [
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
@ -34,7 +32,6 @@ hj_scalacopts = lf_scalacopts + [
"@maven//:com_typesafe_akka_akka_http",
"@maven//:com_typesafe_akka_akka_http_core",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_tpolecat_doobie_core",
"@maven//:org_tpolecat_doobie_free",
@ -102,7 +99,6 @@ json_scala_deps = [
"@maven//:com_typesafe_akka_akka_slf4j",
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_tpolecat_doobie_core",
"@maven//:org_tpolecat_doobie_free",
@ -206,13 +202,11 @@ daml_compile(
],
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:com_typesafe_akka_akka_http_core",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalatest_scalatest_core",
"@maven//:org_scalatest_scalatest_matchers_core",
@ -271,14 +265,12 @@ alias(
da_scala_library(
name = "integration-tests-lib-{}".format(edition),
srcs = glob(["src/itlib/scala/**/*.scala"]),
plugins = [silencer_plugin],
resources = glob(["src/itlib/resources/**/*"]),
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:com_typesafe_akka_akka_http_core",
"@maven//:com_typesafe_scala_logging_scala_logging",
"@maven//:io_spray_spray_json",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
@ -354,7 +346,6 @@ alias(
]),
plugins = [
kind_projector_plugin,
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
@ -421,7 +412,6 @@ alias(
flaky = True,
plugins = [
kind_projector_plugin,
silencer_plugin,
],
resources = glob(["src/it/resources/**/*"]),
scala_deps = [
@ -443,7 +433,6 @@ alias(
"@maven//:org_typelevel_cats_effect",
"@maven//:org_typelevel_cats_free",
"@maven//:org_typelevel_cats_kernel",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scalacopts = hj_scalacopts,
deps = [

View File

@ -6,13 +6,10 @@ package com.daml.http.dbbackend
import com.daml.http.dbbackend.Queries.SurrogateTpId
import com.daml.http.domain.{Party, TemplateId}
import com.daml.http.util.Logging.instanceUUIDLogCtx
import com.daml.scalautil.Statement.discard
import com.daml.scalautil.nonempty.NonEmpty
import doobie.implicits._
import org.openjdk.jmh.annotations._
import scala.collection.compat._
trait QueryBenchmark extends ContractDaoBenchmark {
self: BenchmarkDbConnection =>
@ -59,7 +56,6 @@ trait QueryBenchmark extends ContractDaoBenchmark {
assert(result.size == batchSize)
}
discard(IterableOnce) // only needed for scala 2.12
}
class QueryBenchmarkOracle extends QueryBenchmark with OracleBenchmarkDbConn

View File

@ -10,13 +10,10 @@ import com.daml.http.dbbackend.Queries.SurrogateTpId
import com.daml.http.domain.{Party, TemplateId}
import com.daml.http.query.ValuePredicate
import com.daml.http.util.Logging.instanceUUIDLogCtx
import com.daml.scalautil.Statement.discard
import com.daml.scalautil.nonempty.NonEmpty
import org.openjdk.jmh.annotations._
import spray.json._
import scala.collection.compat._
trait QueryPayloadBenchmark extends ContractDaoBenchmark {
self: BenchmarkDbConnection =>
@ -83,7 +80,6 @@ trait QueryPayloadBenchmark extends ContractDaoBenchmark {
assert(result.size == batchSize)
}
discard(IterableOnce) // only needed for scala 2.12
}
class QueryPayloadBenchmarkOracle extends QueryPayloadBenchmark with OracleBenchmarkDbConn

View File

@ -17,7 +17,6 @@ import org.scalatest.{Assertion, AsyncTestSuite, BeforeAndAfterAll, Inside}
import org.scalatest.matchers.should.Matchers
import scalaz.std.list._
import scala.collection.compat._
import scala.concurrent.Future
abstract class AbstractDatabaseIntegrationTest extends AsyncFreeSpecLike with BeforeAndAfterAll {

View File

@ -31,7 +31,6 @@ import spray.json.{
}
import scala.annotation.nowarn
import scala.collection.compat._
import scala.concurrent.duration._
import scala.concurrent.{Await, Future}

View File

@ -34,7 +34,6 @@ import scalaz.syntax.traverse._
import scalaz.{-\/, OneAnd, OptionT, Show, \/, \/-}
import spray.json.JsValue
import scala.collection.compat._
import scala.concurrent.{ExecutionContext, Future}
import com.daml.ledger.api.{domain => LedgerApiDomain}
import scalaz.std.scalaFuture._

View File

@ -16,7 +16,6 @@ import com.daml.logging.{ContextualizedLogger, LoggingContextOf}
import scalaz.Scalaz._
import scalaz._
import scala.collection.compat._
import scala.concurrent.{ExecutionContext, Future}
import java.time._
import com.daml.ledger.api.{domain => LedgerApiDomain}

View File

@ -48,7 +48,7 @@ import com.daml.logging.{ContextualizedLogger, LoggingContextOf}
import com.daml.metrics.Metrics
import spray.json.{JsArray, JsObject, JsValue, JsonReader, JsonWriter, enrichAny => `sj enrichAny`}
import scala.collection.compat._
import scala.collection.Factory
import scala.collection.mutable.HashSet
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}

View File

@ -11,8 +11,6 @@ import com.daml.ledger.api.v1.transaction.Transaction
import com.daml.ledger.api.v1.transaction_filter.{Filters, InclusiveFilters, TransactionFilter}
import com.daml.ledger.api.refinements.{ApiTypes => lar}
import scala.collection.compat._
object Transactions {
@SuppressWarnings(Array("org.wartremover.warts.Any"))
def allCreatedEvents(transaction: Transaction): ImmArraySeq[CreatedEvent] =

View File

@ -9,8 +9,6 @@ import org.scalatest.freespec.AnyFreeSpec
import org.scalatest.matchers.should.Matchers
import scalaz.NonEmptyList
import scala.collection.compat._
final class DomainSpec extends AnyFreeSpec with Matchers {
private val ledgerId = LedgerId("myledger")
private val appId = ApplicationId("myAppId")

View File

@ -17,7 +17,6 @@ import scalaz.syntax.show._
import scalaz.{Show, \/}
import spray.json._
import scala.collection.compat._
import scala.concurrent.duration._
import scala.concurrent.{Await, ExecutionContext, Future}

View File

@ -6,15 +6,11 @@ load(
"da_scala_library",
"da_scala_test",
"lf_scalacopts",
"silencer_plugin",
)
da_scala_library(
name = "pureconfig-utils",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:com_github_pureconfig_pureconfig_core",
@ -26,7 +22,6 @@ da_scala_library(
"@maven//:org_scalaz_scalaz_core",
],
scalacopts = lf_scalacopts,
# tags = ["maven_coordinates=com.daml:pureconfig-utils:__VERSION__"],
visibility = [
"//visibility:public",
],

View File

@ -12,9 +12,6 @@ import com.daml.error._
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import scala.annotation.nowarn
@nowarn("msg=deprecated")
class ErrorCodeDocumentationGeneratorSpec extends AnyFlatSpec with Matchers {
private val className = ErrorCodeDocumentationGenerator.getClass.getSimpleName

View File

@ -9,7 +9,6 @@ load(
"da_scala_library",
"da_scala_test_suite",
"scaladoc_jar",
"silencer_plugin",
)
load("//bazel_tools:pom_file.bzl", "pom_file")
load("@scala_version//:index.bzl", "scala_major_version_suffix")

View File

@ -5,18 +5,13 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version")
da_scala_library(
name = "ledger-api-client",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
],
@ -51,9 +46,6 @@ da_scala_library(
da_scala_test_suite(
name = "ledger-api-client-tests",
srcs = glob(["src/test/suite/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
@ -64,9 +56,6 @@ da_scala_test_suite(
"@maven//:org_scalatest_scalatest_shouldmatchers",
"@maven//:org_scalatest_scalatest_wordspec",
],
scalacopts = [
"-P:silencer:lineContentFilters=import Compat._",
],
deps = [
":ledger-api-client",
"//language-support/scala/bindings",

View File

@ -27,8 +27,6 @@ import com.google.rpc.status.{Status => StatusProto}
import io.grpc.Status
import org.slf4j.LoggerFactory
import scala.annotation.nowarn
import scala.collection.compat._
import scala.collection.{immutable, mutable}
import scala.concurrent.duration.FiniteDuration
import scala.concurrent.{Future, Promise}
@ -236,7 +234,6 @@ private[commands] class CommandTracker[Context](
}
}
@nowarn("msg=deprecated")
private def registerSubmission(submission: Ctx[Context, CommandSubmission]): Unit = {
val commands = submission.value.commands
val submissionId = commands.submissionId

View File

@ -38,12 +38,10 @@ import org.scalatest.concurrent.ScalaFutures
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.annotation.nowarn
import scala.concurrent.duration.DurationLong
import scala.concurrent.{Future, Promise}
import scala.util.{Failure, Success, Try}
@nowarn("msg=deprecated")
class CommandTrackerFlowTest
extends AsyncWordSpec
with Matchers

View File

@ -6,7 +6,6 @@ load(
"da_scala_library",
"da_scala_test_suite",
"kind_projector_plugin",
"silencer_plugin",
)
load("@scala_version//:index.bzl", "scala_major_version")
@ -92,9 +91,6 @@ da_scala_test_suite(
data = [
"//ledger/test-common/test-certificates",
],
plugins = [
silencer_plugin,
],
resources = ["src/test/resources/logback-test.xml"],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
@ -111,12 +107,8 @@ da_scala_test_suite(
"@maven//:org_scalatest_scalatest_wordspec",
"@maven//:org_scalatestplus_scalacheck_1_15",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scala_lang_modules_scala_parallel_collections",
],
scalacopts = [
"-P:silencer:lineContentFilters=import scala.collection.parallel.CollectionConverters._",
],
deps = [
":ledger-api-common",
":ledger-api-common-scala-tests-lib",

View File

@ -19,8 +19,6 @@ import org.scalatest.{Assertion, BeforeAndAfter}
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.collection.compat._
import scala.collection.compat.immutable.LazyList
import scala.collection.immutable
import scala.collection.immutable.TreeMap
import scala.concurrent.Future.successful

View File

@ -7,7 +7,6 @@ load(
"da_scala_library",
"da_scala_library_suite",
"da_scala_test_suite",
"silencer_plugin",
)
load(
"//rules_daml:daml.bzl",
@ -73,13 +72,9 @@ da_scala_binary(
da_scala_library(
name = "ledger-api-test-tool-%s-lib" % lf_version,
srcs = glob(["src/main/scala/com/daml/ledger/api/testtool/infrastructure/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scala_lang_modules_scala_java8_compat",
"@maven//:org_scalameta_munit",
],
@ -111,12 +106,8 @@ da_scala_binary(
da_scala_library_suite(
name = "ledger-api-test-tool-%s-test-suites" % lf_version,
srcs = suites_sources(lf_version),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_chuusai_shapeless",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
scaladoc = False,
visibility = [
@ -165,14 +156,10 @@ da_scala_binary(
name = "ledger-api-test-tool-%s" % lf_version,
srcs = glob(["src/main/scala/com/daml/ledger/api/testtool/*.scala"]),
main_class = "com.daml.ledger.api.testtool.LedgerApiTestTool",
plugins = [
silencer_plugin,
],
resources = [
"src/main/resources/logback.xml",
],
scala_deps = [
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:com_github_scopt_scopt",
],
tags = [

View File

@ -10,7 +10,6 @@ import scopt.{OptionParser, Read}
import java.io.File
import java.nio.file.{Path, Paths}
import scala.collection.compat.immutable.LazyList
import scala.concurrent.duration.{DurationInt, FiniteDuration}
import scala.util.Try

View File

@ -16,7 +16,6 @@ import io.grpc.Channel
import io.grpc.netty.{NegotiationType, NettyChannelBuilder}
import org.slf4j.LoggerFactory
import scala.collection.compat._
import scala.concurrent.duration.DurationInt
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}

View File

@ -27,7 +27,6 @@ import com.daml.ledger.test.model.Test.DummyWithAnnotation
import io.grpc.Status
import io.grpc.Status.Code
import scala.collection.compat._
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.control.NonFatal

View File

@ -14,7 +14,6 @@ import com.google.protobuf.ByteString
import io.grpc.Status
import java.util.regex.Pattern
import scala.collection.compat._
import scala.concurrent.{ExecutionContext, Future}
final class PackageManagementServiceIT extends LedgerTestSuite {

View File

@ -15,7 +15,6 @@ import io.grpc.Status
import scalaz.Tag
import scalaz.syntax.tag.ToTagOps
import scala.collection.compat._
import scala.util.Random
final class PartyManagementServiceIT extends LedgerTestSuite {

View File

@ -13,7 +13,6 @@ import com.daml.ledger.test.model.Test.Dummy._
import com.daml.ledger.test.model.Test._
import com.daml.platform.api.v1.event.EventOps.{EventOps, TreeEventOps}
import scala.collection.compat._
import scala.collection.immutable.Seq
import scala.concurrent.Future

View File

@ -6,7 +6,6 @@ load(
"da_scala_binary",
"da_scala_library",
"da_scala_test_suite",
"silencer_plugin",
)
load("//ledger/ledger-api-test-tool:conformance.bzl", "conformance_test")
load("@oracle//:index.bzl", "oracle_testing")
@ -35,16 +34,12 @@ all_database_runtime_deps = {dep: None for db in supported_databases for dep in
da_scala_library(
name = "ledger-on-sql",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
resources = glob(["src/main/resources/**/*"]),
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_playframework_anorm_anorm",
"@maven//:org_playframework_anorm_anorm_tokenizer",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalaz_scalaz_core",
],
tags = ["maven_coordinates=com.daml:ledger-on-sql:__VERSION__"],

View File

@ -9,7 +9,6 @@ import org.flywaydb.core.api.migration.{BaseJavaMigration, Context}
import java.security.MessageDigest
import java.sql.{Connection, ResultSet}
import scala.collection.compat.immutable.LazyList
import scala.jdk.CollectionConverters._
private[migrations] abstract class V3__Backfill_Key_Hash_State_Table extends BaseJavaMigration {

View File

@ -12,7 +12,6 @@ import com.daml.ledger.on.sql.queries.Queries._
import com.daml.ledger.participant.state.kvutils.api.LedgerRecord
import com.daml.ledger.participant.state.kvutils.{KVOffsetBuilder, Raw}
import scala.collection.compat._
import scala.collection.immutable
import scala.util.Try

View File

@ -13,7 +13,6 @@ load(
"da_scala_test",
"da_scala_test_suite",
"scaladoc_jar",
"silencer_plugin",
)
load("//bazel_tools:pom_file.bzl", "pom_file")
load("//rules_daml:daml.bzl", "daml_compile")
@ -93,7 +92,6 @@ scala_compile_deps = [
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_playframework_anorm_anorm",
"@maven//:org_playframework_anorm_anorm_tokenizer",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scala_lang_modules_scala_java8_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:io_spray_spray_json",
@ -106,9 +104,6 @@ runtime_deps = [
da_scala_library(
name = "participant-integration-api",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
resources =
glob(
["src/main/resources/**/*"],
@ -130,9 +125,6 @@ da_scala_library(
da_scala_library(
name = "ledger-api-server",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
resources =
glob(
["src/main/resources/**/*"],
@ -152,13 +144,9 @@ da_scala_library(
da_scala_library(
name = "participant-integration-api-tests-lib",
srcs = glob(["src/test/lib/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
@ -241,9 +229,6 @@ da_scala_test_suite(
jvm_flags = [
"-Djava.security.debug=\"certpath ocsp\"", # This facilitates debugging of the OCSP checks mechanism
],
plugins = [
silencer_plugin,
],
resources = glob(["src/test/resources/**/*"]),
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
@ -253,7 +238,6 @@ da_scala_test_suite(
"@maven//:org_mockito_mockito_scala",
"@maven//:org_playframework_anorm_anorm",
"@maven//:org_playframework_anorm_anorm_tokenizer",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",
@ -410,13 +394,7 @@ scaladoc_jar(
"//ledger/participant-state:sources",
],
doctitle = "Daml participant integration API",
plugins = [
silencer_plugin,
],
root_content = "rootdoc.txt",
scalacopts = [
"-P:silencer:checkUnused",
] + (["-P:silencer:lineContentFilters=import scala.collection.compat._"] if scala_major_version != "2.12" else []),
visibility = [
"//visibility:public",
],

View File

@ -34,7 +34,6 @@ import com.daml.platform.store.{ActiveLedgerState, ActiveLedgerStateManager, Let
import org.flywaydb.core.api.migration.{BaseJavaMigration, Context}
import org.slf4j.LoggerFactory
import scala.collection.compat._
import scala.collection.immutable
/** V1 was missing divulgence info

View File

@ -14,8 +14,6 @@ import com.daml.lf.value.Value.ContractId
import com.daml.platform.store.serialization.{KeyHasher, ValueSerializer}
import org.flywaydb.core.api.migration.{BaseJavaMigration, Context}
import scala.collection.compat.immutable.LazyList
private[migration] class V3__Recompute_Key_Hash extends BaseJavaMigration {
// the number of contracts proceeded in a batch.

View File

@ -14,8 +14,6 @@ import com.daml.platform.store.Conversions._
import com.daml.platform.db.migration.translation.TransactionSerializer
import org.flywaydb.core.api.migration.{BaseJavaMigration, Context}
import scala.collection.compat.immutable.LazyList
private[migration] class V4_1__Collect_Parties extends BaseJavaMigration {
// the number of contracts proceeded in a batch.

View File

@ -14,7 +14,7 @@ import com.daml.logging.LoggingContext
import com.daml.platform.participant.util.LfEngineToApi
import com.daml.platform.store.serialization.Compression
import scala.collection.compat.immutable.ArraySeq
import scala.collection.immutable.ArraySeq
import scala.concurrent.{ExecutionContext, Future}
/** An event as it's fetched from the participant index, before

View File

@ -21,7 +21,7 @@ import com.daml.platform.store.backend.common.ComposableQuery.{CompositeSql, Sql
import com.daml.platform.store.cache.LedgerEndCache
import com.daml.platform.store.interning.StringInterning
import scala.collection.compat.immutable.ArraySeq
import scala.collection.immutable.ArraySeq
abstract class EventStorageBackendTemplate(
eventStrategy: EventStrategy,

View File

@ -19,7 +19,6 @@ import org.scalatest._
import org.scalatest.flatspec.AsyncFlatSpec
import org.scalatest.matchers.should.Matchers
import scala.collection.compat._
import scala.concurrent.Future
private[dao] trait JdbcLedgerDaoTransactionTreesSpec

View File

@ -22,7 +22,6 @@ import io.grpc.ManagedChannel
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.collection.compat.immutable.LazyList
import scala.concurrent.Future
final class GrpcServerSpec extends AsyncWordSpec with Matchers with TestResourceContext {

View File

@ -21,7 +21,6 @@ import org.scalatest.Inside.inside
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AsyncWordSpec
import scala.collection.compat._
import scala.collection.concurrent.TrieMap
import scala.concurrent.duration.DurationInt
import scala.concurrent.{ExecutionContext, Future}

View File

@ -6,7 +6,6 @@ load(
"//bazel_tools:scala.bzl",
"da_scala_library",
"da_scala_test_suite",
"silencer_plugin",
)
load(
"//bazel_tools/client_server:client_server_build.bzl",
@ -24,15 +23,11 @@ load("//ledger/test-common:test-common.bzl", "da_scala_dar_resources_library")
da_scala_library(
name = "kvutils",
srcs = glob(["src/main/scala/**/*.scala"]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_scala_lang_modules_scala_java8_compat",
"@maven//:org_scalaz_scalaz_core",
"@maven//:org_scala_lang_modules_scala_collection_compat",
],
tags = ["maven_coordinates=com.daml:participant-state-kvutils:__VERSION__"],
visibility = [
@ -86,14 +81,10 @@ da_scala_library(
"src/test/lib/scala/**/*.scala",
"src/test/lib/{}/**/*.scala".format(scala_major_version),
]),
plugins = [
silencer_plugin,
],
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_mockito_mockito_scala",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scala_lang_modules_scala_java8_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalactic_scalactic",
@ -152,15 +143,11 @@ da_scala_test_suite(
data = [
"//ledger/test-common:model-tests-default.dar",
],
plugins = [
silencer_plugin,
],
resources = glob(["src/test/resources/*"]),
scala_deps = [
"@maven//:com_typesafe_akka_akka_actor",
"@maven//:com_typesafe_akka_akka_stream",
"@maven//:org_mockito_mockito_scala",
"@maven//:org_scala_lang_modules_scala_collection_compat",
"@maven//:org_scalacheck_scalacheck",
"@maven//:org_scalactic_scalactic",
"@maven//:org_scalatest_scalatest_core",

View File

@ -16,10 +16,9 @@ import com.daml.platform.indexer.{IndexerConfig, IndexerStartupMode}
import io.grpc.ServerInterceptor
import scopt.OptionParser
import scala.annotation.{nowarn, unused}
import scala.annotation.unused
import scala.concurrent.duration.FiniteDuration
@nowarn("msg=parameter value config .* is never used") // possibly used in overrides
trait ConfigProvider[ExtraConfig] {
val defaultExtraConfig: ExtraConfig

View File

@ -9,7 +9,7 @@ import com.daml.lf.data.Ref
import com.daml.lf.data.Time.Timestamp
import com.daml.logging.{ContextualizedLogger, LoggingContext}
import scala.collection.compat._
import scala.collection.Factory
import scala.collection.mutable
/** Commit context provides access to state inputs, commit parameters (e.g. record time) and

View File

@ -3,8 +3,6 @@
package com.daml.ledger.participant.state.kvutils.export
import scala.collection.compat.immutable.LazyList
trait LedgerDataImporter {
def read(): LazyList[(SubmissionInfo, WriteSet)]
}

View File

@ -10,7 +10,6 @@ import com.daml.ledger.participant.state.kvutils.export.LedgerExport.LedgerExpor
import com.daml.ledger.participant.state.kvutils.{Conversions, Raw}
import com.daml.lf.data.Ref
import scala.collection.compat.immutable.LazyList
import scala.jdk.CollectionConverters._
final class ProtobufBasedLedgerDataImporter(input: InputStream)

View File

@ -7,7 +7,7 @@ import com.daml.ledger.participant.state.kvutils.store.{DamlStateKey, DamlStateV
import com.daml.ledger.participant.state.kvutils.{Envelope, Raw}
import scala.collection.SortedMap
import scala.collection.compat._
import scala.collection.Factory
final class StateSerializationStrategy(keyStrategy: StateKeySerializationStrategy) {
def serializeState(key: DamlStateKey, value: DamlStateValue): Raw.StateEntry =

View File

@ -18,7 +18,6 @@ import com.daml.lf.data.Ref
import com.daml.logging.{ContextualizedLogger, LoggingContext}
import com.daml.metrics.{Metrics, Timed}
import scala.collection.compat._
import scala.concurrent.{ExecutionContext, Future}
import scala.jdk.CollectionConverters._

Some files were not shown because too many files have changed in this diff Show More