Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
46 changes: 29 additions & 17 deletions .scalafix.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// .scalafix.conf
rules = [
RemoveUnused
SortImports
OrganizeImports
ExplicitResultTypes
fix.scala213.DottyMigrate
// fix.scala213.NullaryOverride
Expand All @@ -14,7 +14,7 @@ ExplicitResultTypes {
ExplicitImplicitTypes.symbolReplacements {
"scala/concurrent/ExecutionContextExecutor#" = "scala/concurrent/ExecutionContext#"
}
RemoveUnused.imports = true
RemoveUnused.imports = false
RemoveUnused.privates = false
RemoveUnused.locals = false

Expand All @@ -28,7 +28,10 @@ ignored-files = [
"SourceSpec.scala",
"StatsSampleSpec.scala",
"ActorFlowSpec.scala",
"FSMTimingSpec.scala"
"FSMTimingSpec.scala",
"ThreadPoolVirtualThreadSpec.scala",
"ForkJoinPoolVirtualThreadSpec.scala",
"VirtualThreadPoolDispatcherSpec.scala"
]

//ignored packages
Expand All @@ -38,17 +41,26 @@ ignored-packages = [
"jdoc"
]

//sort imports, see https://github.com/NeQuissimus/sort-imports
SortImports.asciiSort = false
SortImports.blocks = [
"re:javax?\\.",
"scala.",
"*",
"com.sun."
"re:^(org\\.apache\\.pekko|pekko\\.)\\w*"
"org.reactivestreams."
"io.netty."
"org.scalatest."
"org.slf4j."
"com.typesafe."
]
OrganizeImports {
blankLines = Auto
coalesceToWildcardImportThreshold = null
expandRelative = false
groupedImports = Keep
groups = [
"re:javax?\\.",
"scala.",
"com.sun.",
"re:org\\.apache\\.pekko",
"pekko.",
"org.reactivestreams.",
"io.netty.",
"org.scalatest.",
"org.slf4j.",
"com.typesafe.",
"*"
]
importSelectorsOrder = Ascii
importsOrder = Ascii
removeUnused = true
targetDialect = StandardLayout
}
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ docstrings.wrap = false
indentOperator.preset = spray
maxColumn = 120
lineEndings = preserve
rewrite.rules = [RedundantParens, SortImports, AvoidInfix]
rewrite.rules = [RedundantParens, AvoidInfix]
indentOperator.exemptScope = all
align.preset = some
align.tokens."+" = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import java.util.Optional
import scala.jdk.OptionConverters._

import org.apache.pekko
import pekko.annotation.InternalApi
import pekko.util.OptionVal

import org.slf4j.Marker
import org.slf4j.event.Level

import pekko.annotation.InternalApi
import pekko.util.OptionVal

/**
* Representation of a Log Event issued by a [[pekko.actor.typed.Behavior]]
* when testing with [[pekko.actor.testkit.typed.scaladsl.BehaviorTestKit]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import scala.jdk.FunctionConverters._
import scala.util.{ Failure, Success, Try }

import org.apache.pekko

import pekko.actor.typed.{ ActorRef, Behavior, Props, RecipientRef }
import pekko.annotation.{ DoNotInherit, InternalApi }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.apache.pekko.actor.testkit.typed

import org.apache.pekko

import pekko.annotation.DoNotInherit

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import scala.concurrent.duration.{ Duration, FiniteDuration }
import scala.jdk.DurationConverters._

import org.apache.pekko

import com.typesafe.config.Config

import pekko.actor.typed.ActorSystem
import pekko.actor.typed.Extension
import pekko.actor.typed.ExtensionId
import pekko.util.Timeout

import com.typesafe.config.Config

object TestKitSettings {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import scala.concurrent._
import scala.jdk.FutureConverters._

import org.apache.pekko

import org.slf4j.Logger
import org.slf4j.LoggerFactory

import com.typesafe.config.{ Config, ConfigFactory }

import pekko.{ actor => classic }
import pekko.Done
import pekko.actor.{ ActorPath, ActorRefProvider, Address, ReflectiveDynamicAccess }
Expand All @@ -38,11 +44,6 @@ import pekko.actor.typed.internal.InternalRecipientRef
import pekko.actor.typed.receptionist.Receptionist
import pekko.annotation.InternalApi

import org.slf4j.Logger
import org.slf4j.LoggerFactory

import com.typesafe.config.{ Config, ConfigFactory }

/**
* INTERNAL API
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import scala.util.control.Exception.Catcher
import scala.util.control.NonFatal

import org.apache.pekko

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a change that I prefer that we fix - let's keep no gap between the org.apache.pekko import and the pekko imports

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still tweaking

import pekko.actor.ActorPath
import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.testkit.typed.Effect._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

package org.apache.pekko.actor.testkit.typed.internal

import org.apache.pekko

import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.core.AppenderBase

import org.apache.pekko
import pekko.annotation.InternalApi

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import java.util.concurrent.ConcurrentLinkedQueue
import scala.annotation.tailrec

import org.apache.pekko

import pekko.{ actor => classic }
import pekko.actor.ActorRefProvider
import pekko.actor.typed.ActorRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import scala.util.Try
import scala.util.control.NonFatal

import org.apache.pekko

import pekko.actor.{ ActorPath, Cancellable }
import pekko.actor.testkit.typed.Effect
import pekko.actor.testkit.typed.Effect._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import scala.reflect.ClassTag
import scala.util.matching.Regex

import org.apache.pekko

import org.slf4j.event.Level

import pekko.actor.testkit.typed.LoggingEvent
import pekko.actor.testkit.typed.TestKitSettings
import pekko.actor.testkit.typed.javadsl
Expand All @@ -28,8 +31,6 @@ import pekko.actor.typed.ActorSystem
import pekko.annotation.InternalApi
import pekko.testkit.TestKit

import org.slf4j.event.Level

/**
* INTERNAL API
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import scala.concurrent.ExecutionContextExecutor
import scala.concurrent.duration.FiniteDuration

import org.apache.pekko

import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory }
import org.slf4j.{ Logger, Marker }

import pekko.{ actor => classic }
import pekko.actor.{ ActorPath, ActorRefProvider, InvalidMessageException }
import pekko.actor.testkit.typed.CapturedLogEvent
Expand All @@ -29,9 +33,6 @@ import pekko.actor.typed.internal._
import pekko.annotation.InternalApi
import pekko.util.Helpers

import org.slf4j.{ Logger, Marker }
import org.slf4j.helpers.{ MessageFormatter, SubstituteLoggerFactory }

/**
* INTERNAL API
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ package org.apache.pekko.actor.testkit.typed.internal

import java.util.Collections

import org.apache.pekko

import org.slf4j.{ MDC, Marker }

import ch.qos.logback.classic.spi.ILoggingEvent
import ch.qos.logback.classic.spi.ThrowableProxy
import ch.qos.logback.core.AppenderBase

import org.apache.pekko
import pekko.actor.testkit.typed.LoggingEvent
import pekko.annotation.InternalApi

import org.slf4j.{ MDC, Marker }

/**
* INTERNAL API
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import scala.annotation.tailrec
import scala.collection.immutable

import org.apache.pekko

import pekko.actor.{ ActorPath, Address, RootActorPath }
import pekko.actor.typed.ActorRef
import pekko.annotation.InternalApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

package org.apache.pekko.actor.testkit.typed.internal

import scala.concurrent.{ Await, TimeoutException }
import scala.concurrent.duration.Duration
import scala.concurrent.{ Await, TimeoutException }
import scala.util.control.Exception.Catcher
import scala.util.control.NonFatal

import org.apache.pekko

import pekko.actor.typed.{ ActorRef, ActorSystem, Behavior, Props }
import pekko.actor.typed.scaladsl.ActorContext
import pekko.actor.typed.scaladsl.Behaviors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
package org.apache.pekko.actor.testkit.typed.internal

import java.time.{ Duration => JDuration }
import java.util.{ List => JList }
import java.util.concurrent.BlockingDeque
import java.util.concurrent.LinkedBlockingDeque
import java.util.function.Supplier
import java.util.{ List => JList }

import scala.annotation.tailrec
import scala.collection.immutable
Expand All @@ -28,6 +28,7 @@ import scala.reflect.ClassTag
import scala.util.control.NonFatal

import org.apache.pekko

import pekko.actor.ActorRefProvider
import pekko.actor.ExtendedActorSystem
import pekko.actor.testkit.typed.FishingOutcome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import java.time.Duration
import scala.jdk.DurationConverters._

import org.apache.pekko

import com.typesafe.config.Config

import pekko.actor.DeadLetter
import pekko.actor.Dropped
import pekko.actor.UnhandledMessage
Expand All @@ -31,8 +34,6 @@ import pekko.actor.typed.Props
import pekko.actor.typed.Scheduler
import pekko.util.Timeout

import com.typesafe.config.Config

object ActorTestKit {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import java.util.concurrent.ThreadLocalRandom
import scala.annotation.nowarn

import org.apache.pekko

import com.typesafe.config.Config

import pekko.actor.testkit.typed.{ CapturedLogEvent, Effect }
import pekko.actor.testkit.typed.internal.{ ActorSystemStub, BehaviorTestKitImpl }
import pekko.actor.typed.{ ActorRef, Behavior, Signal }
Expand All @@ -26,8 +29,6 @@ import pekko.annotation.{ ApiMayChange, DoNotInherit }
import pekko.japi.function.{ Function => JFunction }
import pekko.pattern.StatusReply

import com.typesafe.config.Config

object BehaviorTestKit {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import java.time.Duration
import scala.jdk.DurationConverters._

import org.apache.pekko

import pekko.actor.typed.{ ActorRef, Behavior, Props, RecipientRef }

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
package org.apache.pekko.actor.testkit.typed.javadsl

import org.apache.pekko

import com.typesafe.config.Config

import pekko.actor.testkit.typed.internal.TestKitUtils
import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig
import pekko.actor.typed.ActorSystem

import com.typesafe.config.Config

@deprecated("Use JUnitJupiterTestKitBuilder instead", "2.0.0")
final class JUnit5TestKitBuilder() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
package org.apache.pekko.actor.testkit.typed.javadsl

import org.apache.pekko

import com.typesafe.config.Config

import pekko.actor.testkit.typed.internal.TestKitUtils
import pekko.actor.testkit.typed.scaladsl.ActorTestKit.ApplicationTestConfig
import pekko.actor.typed.ActorSystem

import com.typesafe.config.Config

final class JUnitJupiterTestKitBuilder() {

var system: Option[ActorSystem[?]] = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ package org.apache.pekko.actor.testkit.typed.javadsl

import scala.util.control.NonFatal

import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement

import org.apache.pekko.actor.testkit.typed.internal.CapturingAppender

import org.slf4j.LoggerFactory

import org.junit.rules.TestRule
import org.junit.runner.Description
import org.junit.runners.model.Statement

/**
* JUnit `TestRule` to make log lines appear only when the test failed.
*
Expand Down
Loading