From d7aae447a37a3416e44fafb80340019902a59c27 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 6 Oct 2023 14:17:37 +0000 Subject: [PATCH 1/3] Update scalafmt-core to 3.2.2 --- .scalafmt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index eb4d533..0fb14ec 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,4 +1,4 @@ -version = "3.2.1" +version = "3.2.2" align.preset = more maxColumn = 100 From bd3e178847da4a10f5c902647c6b303d97a0fbb2 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 6 Oct 2023 14:17:55 +0000 Subject: [PATCH 2/3] Reformat with scalafmt 3.2.2 Executed command: scalafmt --non-interactive --- publish/src/coursier/publish/dir/Dir.scala | 4 ++-- .../coursier/publish/download/FileDownload.scala | 13 +++++++------ .../src/coursier/publish/logging/OutputFrame.scala | 2 +- .../src/coursier/publish/sonatype/SonatypeApi.scala | 2 +- .../coursier/publish/sonatype/SonatypeTests.scala | 8 ++++---- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/publish/src/coursier/publish/dir/Dir.scala b/publish/src/coursier/publish/dir/Dir.scala index 0258898..0817ed7 100644 --- a/publish/src/coursier/publish/dir/Dir.scala +++ b/publish/src/coursier/publish/dir/Dir.scala @@ -31,7 +31,7 @@ object Dir { .flatMap(files) } finally if (s != null) - s.close() + s.close() } else // ??? @@ -69,7 +69,7 @@ object Dir { s.iterator().asScala.toVector.partition(Files.isDirectory(_)) } finally if (s != null) - s.close() + s.close() } val checkFiles = diff --git a/publish/src/coursier/publish/download/FileDownload.scala b/publish/src/coursier/publish/download/FileDownload.scala index add3911..0fbe180 100644 --- a/publish/src/coursier/publish/download/FileDownload.scala +++ b/publish/src/coursier/publish/download/FileDownload.scala @@ -24,12 +24,13 @@ final case class FileDownload(base: Path) extends Download { if (p.startsWith(base0)) { logger.downloadingIfExists(url) val res = - try if (Files.isRegularFile(p)) { - val lastModified = Files.getLastModifiedTime(p).toInstant - Right(Some((Some(lastModified), Files.readAllBytes(p)))) - } - else - Right(None) + try + if (Files.isRegularFile(p)) { + val lastModified = Files.getLastModifiedTime(p).toInstant + Right(Some((Some(lastModified), Files.readAllBytes(p)))) + } + else + Right(None) catch { case NonFatal(e) => Left(e) diff --git a/publish/src/coursier/publish/logging/OutputFrame.scala b/publish/src/coursier/publish/logging/OutputFrame.scala index 8c2b24d..3ea74cd 100644 --- a/publish/src/coursier/publish/logging/OutputFrame.scala +++ b/publish/src/coursier/publish/logging/OutputFrame.scala @@ -96,7 +96,7 @@ final class OutputFrame( var n = 0 while (n < bufferSize && it.hasNext) { val l = it.next() - // https://stackoverflow.com/a/25189932/3714539 + // https://stackoverflow.com/a/25189932/3714539 .replaceAll("\u001B\\[[\\d;]*[^\\d;]", "") val l0 = if (l.length <= width) l diff --git a/publish/src/coursier/publish/sonatype/SonatypeApi.scala b/publish/src/coursier/publish/sonatype/SonatypeApi.scala index 4b2ee4c..0382e78 100644 --- a/publish/src/coursier/publish/sonatype/SonatypeApi.scala +++ b/publish/src/coursier/publish/sonatype/SonatypeApi.scala @@ -68,7 +68,7 @@ final case class SonatypeApi( logger.listingProfiles(attempt, retryOnTimeout) val res = try get(s"$base/staging/profiles")(Profiles.Profile.listCodec) - .map(_.profile) + .map(_.profile) catch { case NonFatal(e) => logger.listedProfiles(Some(e)) diff --git a/publish/test/src/coursier/publish/sonatype/SonatypeTests.scala b/publish/test/src/coursier/publish/sonatype/SonatypeTests.scala index 53b7c44..55a74d5 100644 --- a/publish/test/src/coursier/publish/sonatype/SonatypeTests.scala +++ b/publish/test/src/coursier/publish/sonatype/SonatypeTests.scala @@ -46,10 +46,10 @@ object SonatypeTests extends TestSuite { ) try sonatypeApi3.sendPromoteStagingRepositoryRequest( - SonatypeApi.Profile("id", "name", "uri"), - "repo", - "description" - ) + SonatypeApi.Profile("id", "name", "uri"), + "repo", + "description" + ) catch { case e: Exception if e.getMessage == "Failed to get uri/promote (http status: 500, response: Internal server error)" => From d633f48f798ae918ffc87f589e9229ef4474c3e6 Mon Sep 17 00:00:00 2001 From: Scala Steward Date: Fri, 6 Oct 2023 14:17:55 +0000 Subject: [PATCH 3/3] Add 'Reformat with scalafmt 3.2.2' to .git-blame-ignore-revs --- .git-blame-ignore-revs | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..5077df9 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# Scala Steward: Reformat with scalafmt 3.2.2 +bd3e178847da4a10f5c902647c6b303d97a0fbb2