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

Update scalafmt-core to 3.8.5 #858

Closed
Closed
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 @@ -6,3 +6,6 @@

# Scala Steward: Reformat with scalafmt 3.8.3
1b46d1df04b53c9969027c1b4da33c0d47d11bd6

# Scala Steward: Reformat with scalafmt 3.8.5
893da8af99210d857f138f93529f6380a7293816
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.5
runner.dialect = Scala213Source3
maxColumn = 100
indent.defnSite = 2
Expand Down
5 changes: 2 additions & 3 deletions cli/src/main/scala/com/advancedtelematic/tuf/cli/Cli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ object Cli extends App with VersionInfo {
"The directory that you want to work with. By default, it is your current working directory."
)

opt[Unit]("verbose").text("Prints the verbose information for the execution.").action {
(_, c) =>
c.copy(verbose = true)
opt[Unit]("verbose").text("Prints the verbose information for the execution.").action { (_, c) =>
c.copy(verbose = true)
}

version("version").text("Prints the current binary version.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,7 @@ class RootRoleResourceSpec
.futureValue
.map(_.status) should contain only KeyGenRequestStatus.ERROR

Put(
apiUri(s"root/${repoId.show}"),
ClientRootGenRequest(keyType = keyType)
) ~> routes ~> check {
Put(apiUri(s"root/${repoId.show}"), ClientRootGenRequest(keyType = keyType)) ~> routes ~> check {
status shouldBe StatusCodes.OK
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ class HttpRemoteDelegationClient()(implicit val ec: ExecutionContext, system: Ac
um.apply(entity)
.recoverWith { case err =>
if (log.isDebugEnabled) {
unmarshallStringOrError(entity).recover { case err => err.getMessage }.foreach {
payload =>
log.warn("Could not unmarshall remote response. Response was: " + payload)
unmarshallStringOrError(entity).recover { case err => err.getMessage }.foreach { payload =>
log.warn("Could not unmarshall remote response. Response was: " + payload)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class PackageSearch()(implicit db: Database) {

}

def hardwareIdsWithPackages(repoId: RepoId): Future[Seq[HardwareIdentifier]] = {
def hardwareIdsWithPackages(repoId: RepoId): Future[Seq[HardwareIdentifier]] = {
implicit val getResult: GetResult[HardwareIdentifier] = GetResult.GetString.andThen { str =>
refineV[ValidHardwareIdentifier](str)
.valueOr(msg =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,7 @@ class RepoResource(keyserverClient: KeyserverClient,
} ~
(patch & path(DelegatedRoleNamePath / "info") & entity(as[DelegationInfo])) {
(delegatedRoleName, delegationInfo) =>
onSuccess(
delegations.setDelegationInfo(repoId, delegatedRoleName, delegationInfo)
) {
onSuccess(delegations.setDelegationInfo(repoId, delegatedRoleName, delegationInfo)) {
complete(StatusCodes.OK)
}
} ~
Expand Down Expand Up @@ -671,7 +669,10 @@ class RepoResource(keyserverClient: KeyserverClient,
complete(editTargetItem(namespace, repoId, filename, item))
}
} ~
withRequestTimeout(userRepoUploadRequestTimeout, timeoutResponseHandler) { // For when SignedPayload[TargetsRole] is too big and takes a long time to upload
withRequestTimeout(
userRepoUploadRequestTimeout,
timeoutResponseHandler
) { // For when SignedPayload[TargetsRole] is too big and takes a long time to upload
decodeRequest {
(pathEnd & put & entity(as[SignedPayload[TargetsRole]])) { signedPayload =>
extractRoleChecksumHeader { checksum =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ class RepoResourceDelegationsSpec
}

private def addNewTrustedDelegationKeysOK(tufKeys: TufKey*)(implicit repoId: RepoId): Unit =
Put(
apiUri(s"repo/${repoId.show}/trusted-delegations/keys"),
tufKeys.asJson
) ~> routes ~> check {
Put(apiUri(s"repo/${repoId.show}/trusted-delegations/keys"), tufKeys.asJson) ~> routes ~> check {
status shouldBe StatusCodes.NoContent
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import org.scalatest.OptionValues.*
import akka.http.scaladsl.model.{HttpEntity, StatusCodes}
import akka.util.ByteString
import com.advancedtelematic.libats.data.PaginationResult
import com.advancedtelematic.tuf.reposerver.util.{RepoResourceDelegationsSpecUtil, ResourceSpec, TufReposerverSpec}
import com.advancedtelematic.tuf.reposerver.util.{
RepoResourceDelegationsSpecUtil,
ResourceSpec,
TufReposerverSpec
}
import com.advancedtelematic.tuf.reposerver.util.NamespaceSpecOps.*
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport.*
import com.advancedtelematic.tuf.reposerver.data.RepoDataType.*
Expand Down Expand Up @@ -593,31 +597,40 @@ class RepoTargetsResourceSpec
}
}

testWithRepo("GET hardwareids-packages returns hwids for which there are packages") { implicit ns => implicit repoId =>
addTargetToRepo(repoId)
testWithRepo("GET hardwareids-packages returns hwids for which there are packages") {
implicit ns => implicit repoId =>
addTargetToRepo(repoId)

Put(
apiUri("user_repo/targets/mypkg_file?name=library&version=0.0.1&hardwareIds=myid001,myid002"),
testEntity
).namespaced ~> routes ~> check {
status shouldBe StatusCodes.NoContent
}
Put(
apiUri(
"user_repo/targets/mypkg_file?name=library&version=0.0.1&hardwareIds=myid001,myid002"
),
testEntity
).namespaced ~> routes ~> check {
status shouldBe StatusCodes.NoContent
}

Put(
apiUri("user_repo/targets/mypkg_file2?name=library&version=0.0.2&hardwareIds=myid002,myid003"),
testEntity2
).namespaced ~> routes ~> check {
status shouldBe StatusCodes.NoContent
}
Put(
apiUri(
"user_repo/targets/mypkg_file2?name=library&version=0.0.2&hardwareIds=myid002,myid003"
),
testEntity2
).namespaced ~> routes ~> check {
status shouldBe StatusCodes.NoContent
}

Get(apiUriV2(s"user_repo/hardwareids-packages")).namespaced ~> routes ~> check {
status shouldBe StatusCodes.OK
val result = responseAs[PaginationResult[HardwareIdentifier]]
result.total shouldBe 3
result.offset shouldBe 0
result.limit shouldBe 3
result.values.map(_.value) should contain theSameElementsAs List("myid001", "myid002", "myid003")
}
Get(apiUriV2(s"user_repo/hardwareids-packages")).namespaced ~> routes ~> check {
status shouldBe StatusCodes.OK
val result = responseAs[PaginationResult[HardwareIdentifier]]
result.total shouldBe 3
result.offset shouldBe 0
result.limit shouldBe 3
result.values.map(_.value) should contain theSameElementsAs List(
"myid001",
"myid002",
"myid003"
)
}
}

}
Loading