Skip to content

Commit

Permalink
fix -Wconf to match new semantics
Browse files Browse the repository at this point in the history
Override order reversed, see also https://github.com/scala/scala/releases
  • Loading branch information
raboof committed Jan 3, 2025
1 parent bcf1c27 commit 4c2d74d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package org.apache.pekko.actor.typed

import scala.annotation.nowarn
import scala.concurrent.duration._
import scala.reflect.ClassTag

Expand Down Expand Up @@ -88,6 +89,8 @@ abstract class ActorContextSpec extends ScalaTestWithActorTestKit with AnyWordSp
"An ActorContext" must {

"be usable from Behavior.interpretMessage" in {
// possibly fixed in 2.13.6 https://github.com/scala/bug/issues/13041
@nowarn("cat=unused-locals")
// compilation only
lazy val b: Behavior[String] = Behaviors.receive { (context, message) =>
Behavior.interpretMessage(b, context, message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ object RequestResponseActors {
val fullPathToDispatcher = "pekko.actor." + dispatcher
val latch = new CountDownLatch(numActors)
val actorsPairs = for {
i <- (1 to (numActors / 2)).toVector
_ <- (1 to (numActors / 2)).toVector
userQueryActor = system.actorOf(
UserQueryActor.props(latch, numQueriesPerActor, numUsersInDBPerActor).withDispatcher(fullPathToDispatcher))
userServiceActor = system.actorOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ class DistributedPubSubMediator(settings: DistributedPubSubSettings)
val topicPrefix = self.path.toStringWithoutAddress
(for {
(_, bucket) <- registry
(key, value) <- bucket.content.toSeq
(key, _) <- bucket.content.toSeq
if key.startsWith(topicPrefix)
topic = key.substring(topicPrefix.length + 1)
if !topic.contains('/') // exclude group topics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class MessageSerializer(val system: ExtendedActorSystem) extends BaseSerializer
else None)
}

@nowarn("msg=deprecated")
def persistentFSMSnapshot(persistentFSMSnapshot: mf.PersistentFSMSnapshot): PersistentFSMSnapshot[Any] = {
PersistentFSMSnapshot(
persistentFSMSnapshot.getStateIdentifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@

package org.apache.pekko.persistence.serialization

import annotation.nowarn

import org.apache.pekko
import pekko.persistence.fsm.PersistentFSM.PersistentFSMSnapshot
import pekko.serialization.SerializationExtension
import pekko.testkit.PekkoSpec

import java.util.Base64

@nowarn("msg=deprecated")
private[serialization] object SnapshotSerializerTestData {
val fsmSnapshot = PersistentFSMSnapshot[String]("test-identifier", "test-data", None)
// https://github.com/apache/pekko/pull/837#issuecomment-1847320309
Expand Down
25 changes: 14 additions & 11 deletions project/PekkoDisciplinePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ object PekkoDisciplinePlugin extends AutoPlugin {
"pekko-stream-tests-tck",
"pekko-testkit")

lazy val defaultScalaOptions = Def.setting(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => "-Wconf:cat=unused-nowarn:s,any:e"
case _ => "-Wconf:cat=unused-nowarn:s,cat=other-shadowing:s,any:e"
lazy val defaultScalaOptions = Def.setting(CrossVersion.partialVersion(scalaVersion.value).get match {
case (3, _) => "-Wconf:cat=unused-nowarn:s,cat=other-shadowing:s,any:e"
case (2, 13) => "-Wconf:any:e,cat=unused-nowarn:s,cat=other-shadowing:s"
case (2, 12) => "-Wconf:cat=unused-nowarn:s,any:e"
})

lazy val nowarnSettings = Seq(
Expand All @@ -101,16 +102,18 @@ object PekkoDisciplinePlugin extends AutoPlugin {
lazy val docs =
Seq(
Compile / scalacOptions -= defaultScalaOptions.value,
Compile / scalacOptions ++= (
if (scalaVersion.value.startsWith("3.")) Nil
else Seq("-Wconf:cat=unused:s,cat=deprecation:s,cat=unchecked:s,any:e")
),
Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value).get match {
case (3, _) => Seq("-Wconf:cat=unused:s,cat=deprecation,cat=other-shadowing:s,any:e")
case (2, 13) => Seq("-Wconf:any:e,cat=unused:s,cat=deprecation:s,cat=unchecked:s")
case (2, 12) => Seq("-Wconf:cat=unused:s,cat=deprecation:s,cat=unchecked:s,any:e")
}),
Test / scalacOptions --= Seq("-Xlint", "-unchecked", "-deprecation"),
Test / scalacOptions -= defaultScalaOptions.value,
Test / scalacOptions ++= (
if (scalaVersion.value.startsWith("3.")) Nil
else Seq("-Wconf:cat=unused:s,cat=deprecation:s,cat=unchecked:s,any:e")
),
Test / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value).get match {
case (3, _) => Seq("-Wconf:cat=unused:s,cat=deprecation,cat=other-shadowing:s,any:e")
case (2, 13) => Seq("-Wconf:any:e,cat=unused:s,cat=deprecation:s,cat=unchecked:s")
case (2, 12) => Seq("-Wconf:cat=unused:s,cat=deprecation:s,cat=unchecked:s,any:e")
}),
Compile / doc / scalacOptions := Seq())

lazy val disciplineSettings =
Expand Down

0 comments on commit 4c2d74d

Please sign in to comment.