Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update scalafmt-core from 3.8.3 to 3.8.6 #2009

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ b20f0ba57795f003fe4d90817422e14b880d6c8c

# Scala Steward: Reformat with scalafmt 3.8.3
36121b1cae26cb45c8e5cbe3dcce11d15612c4ce

# Scala Steward: Reformat with scalafmt 3.8.6
b42a1b4e0a0c574e7db8268867a72e826fe8cf96
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.8.6"

runner.dialect = scala213

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CommitInfoSpec extends AnyWordSpec with ScalaCheckPropertyChecks with shou

"CommitInfo Decoder" should {

"decode valid JSON to a CommitInfo object" in {
"decode valid JSON to a CommitInfo object" in
forAll { commitInfo: CommitInfo =>
json"""{
"id": ${commitInfo.id.value},
Expand All @@ -46,7 +46,6 @@ class CommitInfoSpec extends AnyWordSpec with ScalaCheckPropertyChecks with shou
"parent_ids": ${commitInfo.parents.map(_.value)}
}""".as[CommitInfo] shouldBe Right(commitInfo)
}
}

"decode valid JSON with blank emails to a CommitInfo object" in {
val commitInfo = commitInfos.generateOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,20 @@ class AuthorSpec extends AnyWordSpec with ScalaCheckPropertyChecks with should.M

"withEmail" should {

"instantiate a new Author with username extracted from the email" in {
"instantiate a new Author with username extracted from the email" in
forAll { email: Email =>
Author.withEmail(email) shouldBe Author(email.extractName, email)
}
}
}
}

class CommitterSpec extends AnyWordSpec with ScalaCheckPropertyChecks with should.Matchers {

"withEmail" should {

"instantiate a new Committer with username extracted from the email" in {
"instantiate a new Committer with username extracted from the email" in
forAll { email: Email =>
Committer.withEmail(email) shouldBe Committer(email.extractName, email)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class CommitToEventLogSpec extends AnyWordSpec with MockFactory with should.Matc
"body": $body,
"status": ${event.status}
}"""
case (event: SkippedCommitEvent, body) => json"""{
case (event: SkippedCommitEvent, body) =>
json"""{
"categoryName": "CREATION",
"id": ${event.id},
"project": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SynchronizationSummarySpec extends AnyWordSpec with should.Matchers with S

"get & updated" should {

"return count for the given key" in {
"return count for the given key" in
forAll(resultsAndMaybeCountList) { countsAndResults =>
val summary = countsAndResults
.foldLeft(SynchronizationSummary()) {
Expand All @@ -44,12 +44,11 @@ class SynchronizationSummarySpec extends AnyWordSpec with should.Matchers with S
case (None, result) => summary.get(result) shouldBe 0
}
}
}
}

"increment" should {

"increment the count for the given key" in {
"increment the count for the given key" in
forAll(summaries, updateResults.toGeneratorOfList(max = 10)) { (initialSummary, results) =>
val summary = results.foldLeft(initialSummary)(_.incrementCount(_))

Expand All @@ -60,7 +59,6 @@ class SynchronizationSummarySpec extends AnyWordSpec with should.Matchers with S
val failed = Failed(nonEmptyStrings().generateOne, exceptions.generateOne)
summary.get(failed) shouldBe initialSummary.get(failed) + results.count(_.isInstanceOf[Failed])
}
}
}

"show" should {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DatasetSearchInfoSpec extends AnyWordSpec with should.Matchers with ScalaC

"show" should {

"return String representation of the Info" in {
"return String representation of the Info" in
forAll(datasetSearchInfoObjects) {
case info @ DatasetSearchInfo(topSameAs,
name,
Expand Down Expand Up @@ -76,6 +76,5 @@ class DatasetSearchInfoSpec extends AnyWordSpec with should.Matchers with ScalaC
show"links = [${links.mkString_("; ")}]".some
).flatten.mkString(", ")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,10 @@ class LinkSpec extends AnyWordSpec with should.Matchers with ScalaCheckPropertyC

"show" should {

"returns String representation" in {
"returns String representation" in
forAll(linkObjectsGen(datasetTopmostSameAs.generateOne)) { link =>
link.show shouldBe
show"id = ${link.resourceId}, projectId = ${link.projectId}, datasetId = ${link.datasetId}, visibility = ${link.visibility}"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ModelDatasetSearchInfoSpec extends AnyWordSpec with should.Matchers with S

"show" should {

"return String representation of the Info" in {
"return String representation of the Info" in
forAll(modelDatasetSearchInfoObjects) {
case info @ ModelDatasetSearchInfo(topSameAs,
name,
Expand Down Expand Up @@ -65,6 +65,5 @@ class ModelDatasetSearchInfoSpec extends AnyWordSpec with should.Matchers with S
show"link = $link".some
).flatten.mkString(", ")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class CalculatorInfoSetSpec

"show" should {

"return String containing project id and slug along with model and TS search info" in {
"return String containing project id and slug along with model and TS search info" in
forAll(anyProjectEntities.map(_.to[entities.Project])) { project =>
val modelInfo = modelDatasetSearchInfoObjects(withLinkTo = project).generateOne

Expand All @@ -209,7 +209,6 @@ class CalculatorInfoSetSpec
maybeTSInfo.map(tsi => show"tsInfo = [$tsi]")
).flatten.mkString(", ")
}
}
}

private def searchIntoToString(info: ModelDatasetSearchInfo) = List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ class EncodersSpec extends AnyWordSpec with should.Matchers with ScalaCheckPrope

"searchInfoEncoder" should {

"turn a SearchInfo object into a Set of relevant Quads" in {

"turn a SearchInfo object into a Set of relevant Quads" in
forAll(datasetSearchInfoObjects) { searchInfo =>
searchInfo.asQuads shouldBe Set(
DatasetsQuad(searchInfo.topmostSameAs, rdf / "type", renku / "DiscoverableDataset"),
Expand All @@ -88,7 +87,6 @@ class EncodersSpec extends AnyWordSpec with should.Matchers with ScalaCheckPrope
maybeImagesConcatToQuad(searchInfo).toSet ++
linksToQuads(searchInfo)
}
}
}

private def createdOrPublishedToQuad(topmostSameAs: datasets.TopmostSameAs): datasets.CreatedOrPublished => Quad = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ProjectSearchInfoSpec extends AnyWordSpec with should.Matchers with ScalaC

"show" should {

"return a String representation of the Info" in {
"return a String representation of the Info" in
forAll(projectSearchInfoObjects) {
case info @ ProjectSearchInfo(id,
name,
Expand Down Expand Up @@ -60,6 +60,5 @@ class ProjectSearchInfoSpec extends AnyWordSpec with should.Matchers with ScalaC
}
).flatten.mkString(", ")
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class EncodersSpec extends AnyWordSpec with should.Matchers with ScalaCheckPrope

"searchInfoEncoder" should {

"turn a SearchInfo object into a Set of relevant Quads" in {

"turn a SearchInfo object into a Set of relevant Quads" in
forAll(projectSearchInfoObjects) { searchInfo =>
searchInfo.asQuads shouldBe Set(
ProjectsQuad(searchInfo.id, rdf / "type", renku / "DiscoverableProject"),
Expand All @@ -55,7 +54,6 @@ class EncodersSpec extends AnyWordSpec with should.Matchers with ScalaCheckPrope
maybeKeywordsConcatToQuad(searchInfo).toSet ++
maybeImagesConcatToQuad(searchInfo).toSet
}
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class StatusChangeEventSpec extends AnyWordSpec with should.Matchers with ScalaC

"StatusChangeEvent" should {

"be serializable and deserializable to and from Json" in {
"be serializable and deserializable to and from Json" in
forAll(StatusChangeGenerators.statusChangeEvents) { event =>
val ev = event match {
case ttg: ToTriplesGenerated => ttg.copy(payload = ZippedEventPayload.empty)
Expand All @@ -41,7 +41,6 @@ class StatusChangeEventSpec extends AnyWordSpec with should.Matchers with ScalaC

ev.asJson.as[StatusChangeEvent] shouldBe Right(ev)
}
}

Set(
StatusChangeGenerators.toTripleStoreEvents,
Expand Down Expand Up @@ -82,13 +81,12 @@ class StatusChangeEventSpec extends AnyWordSpec with should.Matchers with ScalaC
}
}
"encode" should {
"encode a discriminator value" in {
"encode a discriminator value" in
forAll(StatusChangeGenerators.statusChangeEvents) { event =>
val json = event.asJson
val subCategory = json.asObject.flatMap(_.apply("subCategory"))
subCategory shouldBe Some(event.subCategoryName.asJson)
}
}

"encode a discriminator value when using specific codec" in {
val event: RollbackToAwaitingDeletion = StatusChangeGenerators.rollbackToAwaitingDeletionEvents.generateOne
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ class CollectingTestClient[F[_]: Async] extends Client[F] {
}

object TestClient {
def expectingMode[F[_]: Async]: ExpectingTestClient[F] = new ExpectingTestClient[F]
def expectingMode[F[_]: Async]: ExpectingTestClient[F] = new ExpectingTestClient[F]
def collectingMode[F[_]: Async]: CollectingTestClient[F] = new CollectingTestClient[F]
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private class MicroserviceRoutes[F[_]: Sync](
case GET -> Root / "events" / EventId(eventId) / ProjectId(projectId) => respond503IfMigrating(getDetails(CompoundEventId(eventId, projectId)))
case GET -> Root / "events" / EventId(eventId) / ProjectSlug(projectSlug) / "payload" => respond503IfMigrating(eventPayloadEndpoint.getEventPayload(eventId, projectSlug))
case GET -> Root / "ping" => Ok("pong")
case GET -> Root / "migration-status" => isMigrating.get.flatMap {isMigrating => Ok(json"""{"isMigrating": $isMigrating}""")}
case GET -> Root / "migration-status" => isMigrating.get.flatMap{isMigrating => Ok(json"""{"isMigrating": $isMigrating}""")}
case GET -> Root / "status" => respond503IfMigrating(`GET /status`)
case req @ POST -> Root / "subscriptions" => respond503IfMigrating(addSubscription(req))
}.withMetrics.map(_ <+> versionRoutes())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ private[producers] object SubscriptionCategory {

val categoryName: CategoryName = CategoryName("AWAITING_GENERATION")

def apply[F[
_
]: Async: Parallel: SessionResource: DefaultSubscriberTracker: Logger: MetricsRegistry: QueriesExecutionTimes: EventStatusGauges]
: F[producers.SubscriptionCategory[F]] = for {
def apply[
F[
_
]: Async: Parallel: SessionResource: DefaultSubscriberTracker: Logger: MetricsRegistry: QueriesExecutionTimes: EventStatusGauges
]: F[producers.SubscriptionCategory[F]] = for {
implicit0(subscribers: DefaultSubscribers[F]) <- DefaultSubscribers[F](categoryName)
eventFetcher <- EventFinder[F]
dispatchRecovery <- DispatchRecovery[F]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ import org.typelevel.log4cats.Logger

private[producers] object SubscriptionCategory {

def apply[F[
_
]: Async: Parallel: SessionResource: DefaultSubscriberTracker: Logger: MetricsRegistry: QueriesExecutionTimes: EventStatusGauges]
: F[SubscriptionCategory[F]] = for {
def apply[
F[
_
]: Async: Parallel: SessionResource: DefaultSubscriberTracker: Logger: MetricsRegistry: QueriesExecutionTimes: EventStatusGauges
]: F[SubscriptionCategory[F]] = for {
implicit0(subscribers: DefaultSubscribers[F]) <- DefaultSubscribers[F](categoryName)
eventDelivery <- eventdelivery.EventDelivery[F, CleanUpEvent](
eventDeliveryIdExtractor = (event: CleanUpEvent) => DeletingProjectDeliverId(event.project.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,17 @@ class ChangeDateSpec extends AnyWordSpec with should.Matchers with ScalaCheckPro

"instantiation" should {

"succeed for timestamps not in the future" in {
"succeed for timestamps not in the future" in
forAll(timestamps(max = Instant.now())) { value =>
ChangeDate.from(value).map(_.value) shouldBe Right(value)
}
}

"fail for timestamps from the future" in {
"fail for timestamps from the future" in
forAll(timestamps(min = Instant.now().plus(1, SECONDS))) { value =>
val Left(exception) = ChangeDate.from(value).map(_.value)
exception shouldBe an[IllegalArgumentException]
exception.getMessage shouldBe s"${ChangeDate.typeName} cannot be in the future"
}
}
}
}

Expand All @@ -101,16 +99,14 @@ class MigrationMessageSpec extends AnyWordSpec with ScalaCheckPropertyChecks wit
MigrationMessage shouldBe an[NonBlank[_]]
}

"be instantiatable from any non-blank string" in {
"be instantiatable from any non-blank string" in
forAll(nonEmptyStrings()) { body =>
MigrationMessage.from(body).map(_.value) shouldBe Right(body)
}
}

"be instantiatable from an exception and contain the stack trace" in {
"be instantiatable from an exception and contain the stack trace" in
forAll(nestedExceptions) { exception =>
MigrationMessage(exception).value shouldBe Message.Error.fromStackTrace(exception).show
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ class EventSpec extends AnyWordSpec with ScalaCheckPropertyChecks with should.Ma

"compoundEventId" should {

"create a CompoundEventId from the event's id and project id" in {
"create a CompoundEventId from the event's id and project id" in
forAll { event: Event =>
event.compoundEventId shouldBe CompoundEventId(event.id, event.project.id)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ class TotalCapacitySpec extends AnyWordSpec with should.Matchers with ScalaCheck

"*" should {

"multiple the Capacity's value by the given value" in {
"multiple the Capacity's value by the given value" in
forAll { (totalCapacity: TotalCapacity, value: Double) =>
totalCapacity * value shouldBe totalCapacity.value * value
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,18 @@ class EventFinderSpec
"return no Event " +
"- case when there are multiple rows for the same version " +
"one in Sent for less than SentStatusTimeout" +
"but also one in RecoverableFailure for more than RecoverableStatusTimeout" in testDBResource.use {
implicit cfg =>
for {
_ <- insertSubscriptionRecord(subscriberUrls.generateOne, version, Sent, less(than = sentStatusTimeout))
_ <- insertSubscriptionRecord(subscriberUrls.generateOne,
version,
RecoverableFailure,
more(than = recoverableStatusTimeout)
)
_ <- insertSubscriptionRecord(url, version, New, ChangeDate(now))
"but also one in RecoverableFailure for more than RecoverableStatusTimeout" in testDBResource.use { implicit cfg =>
for {
_ <- insertSubscriptionRecord(subscriberUrls.generateOne, version, Sent, less(than = sentStatusTimeout))
_ <- insertSubscriptionRecord(subscriberUrls.generateOne,
version,
RecoverableFailure,
more(than = recoverableStatusTimeout)
)
_ <- insertSubscriptionRecord(url, version, New, ChangeDate(now))

_ <- finder.popEvent().asserting(_ shouldBe None)
} yield ()
_ <- finder.popEvent().asserting(_ shouldBe None)
} yield ()
}

"return Migration Request Event for the most recent version row with Sent " +
Expand Down
Loading
Loading