From 10f570064e33004ea236b96489ea762bf6b02bd9 Mon Sep 17 00:00:00 2001 From: Broad Bot <61600560+broadbot@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:18:53 -0800 Subject: [PATCH] CORE-69: Update scalafmt-core from 3.6.1 to 3.8.3 (#1499) * Update scalafmt-core to 3.8.3 * Reformat with scalafmt 3.8.3 Executed command: scalafmt --non-interactive * Add 'Reformat with scalafmt 3.8.3' to .git-blame-ignore-revs --------- Co-authored-by: David An Co-authored-by: Saman Ehsan --- .git-blame-ignore-revs | 3 +++ .scalafmt.conf | 2 +- automation/project/Dependencies.scala | 6 +++-- .../dsde/workbench/sam/MockTestSupport.scala | 2 +- project/Dependencies.scala | 26 ++++++++++++++++--- .../sam/dataAccess/PostgresGroupDAO.scala | 17 +++++------- 6 files changed, 38 insertions(+), 18 deletions(-) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4bd5edcd9..778dc87cb 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,2 +1,5 @@ # Scala Steward: Reformat with scalafmt 3.6.1 0c093c52c09d7b12cdbd38008e0bbc58c9d110be + +# Scala Steward: Reformat with scalafmt 3.8.3 +fc6844bda9d3bdf0b5751381ed9e402fdeb577b8 diff --git a/.scalafmt.conf b/.scalafmt.conf index 47e45a8de..b0234070a 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version=3.6.1 +version=3.8.3 style = default runner.dialect = scala213 diff --git a/automation/project/Dependencies.scala b/automation/project/Dependencies.scala index a9793ad49..5b01ab480 100644 --- a/automation/project/Dependencies.scala +++ b/automation/project/Dependencies.scala @@ -34,8 +34,10 @@ object Dependencies { ExclusionRule("com.google.guava", "guava-jdk5"), ExclusionRule("org.apache.httpcomponents", "httpclient") ), - "com.google.api-client" % "google-api-client" % "1.22.0" excludeAll (ExclusionRule("com.google.guava", "guava-jdk5"), - ExclusionRule("org.apache.httpcomponents", "httpclient")), + "com.google.api-client" % "google-api-client" % "1.22.0" excludeAll ( + ExclusionRule("com.google.guava", "guava-jdk5"), + ExclusionRule("org.apache.httpcomponents", "httpclient") + ), "com.typesafe.akka" %% "akka-http-core" % akkaHttpV, "com.typesafe.akka" %% "akka-stream-testkit" % akkaV, "com.typesafe.akka" %% "akka-http" % akkaHttpV, diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala index 5e3d9e603..e7ed9ae97 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/MockTestSupport.scala @@ -158,7 +158,7 @@ object MockTestSupport extends MockTestSupport { policyDAO, googleExt, FakeOpenIDConnectConfiguration, - azureService:Option[AzureService] + azureService: Option[AzureService] ) } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 8a4dda6d6..0dbbf165a 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -95,13 +95,24 @@ object Dependencies { val excludeGoogleAutoValue = ExclusionRule(organization = "com.google.auto.value", name = "auto-value") val excludeBouncyCastle = ExclusionRule("org.bouncycastle") val workbenchGoogle2: ModuleID = - "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V excludeAll (excludeWorkbenchModel, excludeWorkbenchUtil, excludeGoogleAutoValue, excludeBouncyCastle) + "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V excludeAll ( + excludeWorkbenchModel, + excludeWorkbenchUtil, + excludeGoogleAutoValue, + excludeBouncyCastle + ) val workbenchNotifications: ModuleID = "org.broadinstitute.dsde.workbench" %% "workbench-notifications" % workbenchNotificationsV excludeAll (excludeWorkbenchGoogle, excludeWorkbenchModel) val workbenchGoogleTests: ModuleID = - "org.broadinstitute.dsde.workbench" %% "workbench-google" % workbenchGoogleV % "test" classifier "tests" excludeAll (excludeWorkbenchUtil, excludeWorkbenchModel) + "org.broadinstitute.dsde.workbench" %% "workbench-google" % workbenchGoogleV % "test" classifier "tests" excludeAll ( + excludeWorkbenchUtil, + excludeWorkbenchModel + ) val workbenchGoogle2Tests: ModuleID = - "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V % "test" classifier "tests" excludeAll (excludeWorkbenchUtil, excludeWorkbenchModel) + "org.broadinstitute.dsde.workbench" %% "workbench-google2" % workbenchGoogle2V % "test" classifier "tests" excludeAll ( + excludeWorkbenchUtil, + excludeWorkbenchModel + ) val googleStorageLocal: ModuleID = "com.google.cloud" % "google-cloud-nio" % "0.127.26" % "test" // needed for mocking google cloud storage. Should use same version as wb-libs @@ -135,7 +146,14 @@ object Dependencies { ) val cloudResourceLib: ModuleID = - "bio.terra" % "terra-cloud-resource-lib" % crlVersion excludeAll (excludeGoogleServiceUsage, excludeGoogleCloudResourceManager, excludeJerseyCore, excludeJerseyMedia, excludeSLF4J, excludeAwsSdk) + "bio.terra" % "terra-cloud-resource-lib" % crlVersion excludeAll ( + excludeGoogleServiceUsage, + excludeGoogleCloudResourceManager, + excludeJerseyCore, + excludeJerseyMedia, + excludeSLF4J, + excludeAwsSdk + ) val azureManagedApplications: ModuleID = "com.azure.resourcemanager" % "azure-resourcemanager-managedapplications" % "1.0.0-beta.4" diff --git a/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala b/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala index 7507fca4d..265495033 100644 --- a/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala +++ b/src/main/scala/org/broadinstitute/dsde/workbench/sam/dataAccess/PostgresGroupDAO.scala @@ -28,8 +28,8 @@ import scala.util.{Failure, Try} * * Example database records: group(7795) contains user(userid) group(7798) contains user(userid) group(7801) contains group(7798) and group(7799) * - * testdb=# select * from sam_group_member; id | group_id | member_group_id | member_user_id - * -------+----------+-----------------+---------------- 15636 | 7795 | | userid 15637 | 7798 | | userid 15638 | 7801 | 7798 | 15639 | 7801 | 7799 | + * testdb=# select * from sam_group_member; id | group_id | member_group_id | member_user_id -------+----------+-----------------+---------------- 15636 | 7795 + * \| | userid 15637 | 7798 | | userid 15638 | 7801 | 7798 | 15639 | 7801 | 7799 | * * testdb=# select * from sam_group_member_flat; id | group_id | member_group_id | member_user_id | group_membership_path | last_group_membership_element * --------+----------+-----------------+----------------+-----------------------+------------------------------ 345985 | 7795 | | userid | {7795} | 7795 @@ -115,19 +115,16 @@ trait PostgresGroupDAO { * the head path + tail path * * Example: Insert group T into group H. H starts empty but is already a member of groups A and B. T already has member groups X and Y which are empty. The - * flat group model starts containing: Group | Member Group | Path - * ------|--------------|------ A | H | {A} B | H | {B} T | X | {T} T | Y | {T} + * flat group model starts containing: Group | Member Group | Path ------|--------------|------ A | H | {A} B | H | {B} T | X | {T} T | Y | {T} * - * step 1 inserts direct membership of T in H Group | Member Group | Path - * ------|--------------|------ H | T | {H} + * step 1 inserts direct membership of T in H Group | Member Group | Path ------|--------------|------ H | T | {H} * - * step 2 inserts indirect memberships T in A and B Group | Member Group | Path - * ------|--------------|------ A | T | {A,H} B | T | {B,H} + * step 2 inserts indirect memberships T in A and B Group | Member Group | Path ------|--------------|------ A | T | {A,H} B | T | {B,H} * * step 3 inserts T's lower group hierarchy so that X and Y are members of H, A and B. The tail records are all of the records above where Group is T: ((T, * X, {T}), (T, Y, {T}) The head records are all of the records above where Member Group is T and the last path element is H: ((H, T, {H}), (A, T, {A,H}), - * (B, T, {B,H})) Group | Member Group | Path - * ------|--------------|------ H | X | {H,T} H | Y | {H,T} A | X | {A,H,T} A | Y | {A,H,T} B | X | {B,H,T} B | Y | {B,H,T} + * (B, T, {B,H})) Group | Member Group | Path ------|--------------|------ H | X | {H,T} H | Y | {H,T} A | X | {A,H,T} A | Y | {A,H,T} B | X | {B,H,T} B | Y + * \| {B,H,T} * * @param groupId * group being added to