Skip to content

Commit

Permalink
Merge pull request #73 from Gedochao/maintenance/bump-scalafmt
Browse files Browse the repository at this point in the history
Bump `scalafmt` to 3.8.3
  • Loading branch information
tgodzik authored Dec 9, 2024
2 parents 7883f0e + 4b3cada commit 846b13b
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.2.1"
version = "3.8.3"

align.preset = more
maxColumn = 100
Expand Down
4 changes: 3 additions & 1 deletion publish/src/coursier/publish/MavenMetadata.scala
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ object MavenMetadata {
<timestamp>{snapshotVersioning._1.format(timestampPattern)}</timestamp>
<buildNumber>{snapshotVersioning._2}</buildNumber>
</snapshot>
<lastUpdated>{now.atOffset(ZoneOffset.UTC).toLocalDateTime.format(lastUpdatedPattern)}</lastUpdated>
<lastUpdated>{
now.atOffset(ZoneOffset.UTC).toLocalDateTime.format(lastUpdatedPattern)
}</lastUpdated>
<snapshotVersions>
{
artifacts.map {
Expand Down
6 changes: 4 additions & 2 deletions publish/src/coursier/publish/Pom.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ object Pom {
<name>{d.name}</name>
<url>{d.url}</url>
</developer>
// + optional mail
// + optional mail
}
}
</developers>
Expand All @@ -131,7 +131,9 @@ object Pom {
<groupId>{depOrg.value}</groupId>
<artifactId>{depName.value}</artifactId>
<version>{ver}</version>
{confOpt.fold[NodeSeq](Nil)(c => <scope>{c}</scope>)}
{
confOpt.fold[NodeSeq](Nil)(c => <scope>{c}</scope>)
}
</dependency>
}
}
Expand Down
4 changes: 2 additions & 2 deletions publish/src/coursier/publish/dir/Dir.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ object Dir {
.flatMap(files)
}
finally if (s != null)
s.close()
s.close()
}
else
// ???
Expand Down Expand Up @@ -69,7 +69,7 @@ object Dir {
s.iterator().asScala.toVector.partition(Files.isDirectory(_))
}
finally if (s != null)
s.close()
s.close()
}

val checkFiles =
Expand Down
10 changes: 5 additions & 5 deletions publish/src/coursier/publish/download/FileDownload.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ final case class FileDownload(base: Path) extends Download {
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)
val lastModified = Files.getLastModifiedTime(p).toInstant
Right(Some((Some(lastModified), Files.readAllBytes(p))))
}
else
Right(None)
catch {
case NonFatal(e) =>
Left(e)
Expand Down
3 changes: 2 additions & 1 deletion publish/src/coursier/publish/fileset/Group.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ object Group {
now: Instant
): Module =
if (
org.isEmpty && name.isEmpty && version.isEmpty && licenses.isEmpty && developers.isEmpty && homePage.isEmpty && gitDomainPath.isEmpty
org.isEmpty && name.isEmpty && version.isEmpty && licenses.isEmpty && developers
.isEmpty && homePage.isEmpty && gitDomainPath.isEmpty
)
this
else
Expand Down
2 changes: 1 addition & 1 deletion publish/src/coursier/publish/logging/OutputFrame.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions publish/src/coursier/publish/signing/Signer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ trait Signer {
.collect {
case Left((path, content))
if !signed(path) &&
!path.elements.lastOption.exists(n =>
dontSignExtensions.exists(e => n.endsWith("." + e))
) &&
!path.elements.lastOption.exists(n =>
dontSignFiles(n) || dontSignFiles.exists(f => n.startsWith(f + "."))
) =>
!path.elements.lastOption.exists(n =>
dontSignExtensions.exists(e => n.endsWith("." + e))
) &&
!path.elements.lastOption.exists(n =>
dontSignFiles(n) || dontSignFiles.exists(f => n.startsWith(f + "."))
) =>
(path, content)
}

Expand Down
2 changes: 1 addition & 1 deletion publish/src/coursier/publish/sonatype/SonatypeApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)" =>
Expand Down

0 comments on commit 846b13b

Please sign in to comment.