diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/pull_request_template.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE/pull_request_template.md rename to .github/pull_request_template.md diff --git a/core/src/main/scala/nz/co/bottech/scala2plantuml/ClassDiagramRenderer.scala b/core/src/main/scala/nz/co/bottech/scala2plantuml/ClassDiagramRenderer.scala index fea2301..655b6bc 100644 --- a/core/src/main/scala/nz/co/bottech/scala2plantuml/ClassDiagramRenderer.scala +++ b/core/src/main/scala/nz/co/bottech/scala2plantuml/ClassDiagramRenderer.scala @@ -115,7 +115,7 @@ object ClassDiagramRenderer { case head +: tail => val nextOuter = renderElement(head, previous, outer, writer, elementsWithNames.names) loop(tail, Some(head), nextOuter) - case Seq() => + case _ => if (outer.nonEmpty) writer.write("\n}") writer.write('\n') } diff --git a/core/src/main/scala/nz/co/bottech/scala2plantuml/DiagramModifications.scala b/core/src/main/scala/nz/co/bottech/scala2plantuml/DiagramModifications.scala index 6260229..a2579c7 100644 --- a/core/src/main/scala/nz/co/bottech/scala2plantuml/DiagramModifications.scala +++ b/core/src/main/scala/nz/co/bottech/scala2plantuml/DiagramModifications.scala @@ -79,7 +79,7 @@ private[scala2plantuml] object DiagramModifications { loop(tail, aggregations + aggregation, acc :+ aggregation) case head +: tail => loop(tail, aggregations, acc :+ head) - case Seq() => acc + case _ => acc } val newElements = loop(elements, Set.empty, Vector.empty) elementsWithNames.copy(elements = newElements) diff --git a/core/src/main/scala/nz/co/bottech/scala2plantuml/SemanticDbLoader.scala b/core/src/main/scala/nz/co/bottech/scala2plantuml/SemanticDbLoader.scala index cab9098..2346167 100644 --- a/core/src/main/scala/nz/co/bottech/scala2plantuml/SemanticDbLoader.scala +++ b/core/src/main/scala/nz/co/bottech/scala2plantuml/SemanticDbLoader.scala @@ -24,7 +24,7 @@ private[scala2plantuml] class SemanticDBLoader(prefixes: Seq[String], classLoade case Left(error) => loop(tail, errors ++ error) case Right(value) => Right(value) } - case Seq() => Left(errors) + case _ => Left(errors) } semanticdbPath(symbol).flatMap { path => val paths = diff --git a/core/src/main/scala/nz/co/bottech/scala2plantuml/TypeHierarchy.scala b/core/src/main/scala/nz/co/bottech/scala2plantuml/TypeHierarchy.scala index b61874d..0e2b50f 100644 --- a/core/src/main/scala/nz/co/bottech/scala2plantuml/TypeHierarchy.scala +++ b/core/src/main/scala/nz/co/bottech/scala2plantuml/TypeHierarchy.scala @@ -11,10 +11,10 @@ final private[scala2plantuml] case class TypeHierarchy( @tailrec def loop(remaining: Seq[TypeHierarchy], seen: Set[String]): Boolean = remaining match { - case Nil => false case head +: tail if seen.contains(head.symbolInformation.symbol) => loop(tail, seen) case head +: _ if head.symbolInformation.symbol == parent => true case head +: tail => loop(head.parents ++ tail, seen + head.symbolInformation.symbol) + case _ => false } loop(parents, Set.empty) } diff --git a/project/SbtPluginSubProjectPlugin.scala b/project/SbtPluginSubProjectPlugin.scala index ce0d9db..8c264bd 100644 --- a/project/SbtPluginSubProjectPlugin.scala +++ b/project/SbtPluginSubProjectPlugin.scala @@ -7,6 +7,7 @@ import sbt.ScriptedPlugin.autoImport.scripted import sbt._ import sbt.plugins.SbtPlugin import sbtversionpolicy.SbtVersionPolicyMima +import sbtversionpolicy.SbtVersionPolicyPlugin.autoImport.versionPolicyDependencySchemes // This is all the crazy hacks to get cross compiling working with an sub-project that is an sbt plugin. object SbtPluginSubProjectPlugin extends AutoPlugin { @@ -23,6 +24,7 @@ object SbtPluginSubProjectPlugin extends AutoPlugin { override def projectSettings: Seq[Def.Setting[_]] = List( crossScalaVersions := Nil, + mimaPreviousArtifacts := defaultIfCannotBuild(mimaPreviousArtifacts, Set.empty[ModuleID]).value, // Remove all project dependencies for Scala 2.13 as they will not resolve when cross building. projectDependencies := taskDefaultIfSkipped(projectDependencies, Nil).value, scripted := inputDefaultIfSkipped(scripted, ()).evaluated, @@ -32,7 +34,10 @@ object SbtPluginSubProjectPlugin extends AutoPlugin { // Skip everything else otherwise it will just fail. skip := !spspCanBuild.value, undeclaredCompileDependenciesFilter -= moduleFilter(), - mimaPreviousArtifacts := defaultIfCannotBuild(mimaPreviousArtifacts, Set.empty[ModuleID]).value + // These transitive dependencies that have been "vendored" by sbt appear as though they are + // pre-release as they contain build metadata. + // Trust that sbt correctly manages its own version policy in accordance with its dependencies. + versionPolicyDependencySchemes += "org.scala-sbt.jline" % "*" % "always" ) def defaultIfCannotBuild[A](setting: Def.Initialize[A], default: => A): Def.Initialize[A] = diff --git a/project/build.properties b/project/build.properties index bb07780..ddffd37 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.4.8 +sbt.version = 1.4.9 diff --git a/project/plugins.sbt b/project/plugins.sbt index 4748c87..fd17e8d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,17 +1,11 @@ addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "1.0.0-RC5") addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") -addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7") addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "0.2.16") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.16") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17") addSbtPlugin("net.vonbuchholtz" % "sbt-dependency-check" % "3.1.1") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.18") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0") addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.13") - -lazy val root = (project in file(".")).dependsOn(sonatypePlugin) - -lazy val sonatypePlugin = RootProject( - uri("git://github.com/steinybot/sbt-sonatype#5a0ace0551b5d58debbf4aae4a1b5f9b5d888ef1") -)