Skip to content

Commit

Permalink
Merge pull request #25 from mdedetrich/update-and-apply-scalafmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ennru authored Mar 18, 2022
2 parents eb1be2f + ca858de commit 0b71eec
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 38 deletions.
7 changes: 4 additions & 3 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version = 2.1.0-RC2
version = 3.4.3
runner.dialect = scala213
maxColumn = 120
docstrings = JavaDoc
docstrings.style = Asterisk
assumeStandardLibraryStripMargin = true
rewrite.rules = [RedundantBraces, RedundantParens, SortImports, SortModifiers]
unindentTopLevelOperators = true
indentOperator.exemptScope = all
align.tokens = [
{code = "%", owner = "Term.ApplyInfix"},
{code = "%%", owner = "Term.ApplyInfix"},
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ sbtPlugin := true
enablePlugins(SbtPlugin)
import scala.collection.JavaConverters._
scriptedLaunchOpts += ("-Dproject.version=" + version.value)
scriptedLaunchOpts ++= java.lang.management.ManagementFactory.getRuntimeMXBean.getInputArguments.asScala.filter(
a => Seq("-Xmx", "-Xms", "-XX", "-Dfile").exists(a.startsWith)
scriptedLaunchOpts ++= java.lang.management.ManagementFactory.getRuntimeMXBean.getInputArguments.asScala.filter(a =>
Seq("-Xmx", "-Xms", "-XX", "-Dfile").exists(a.startsWith)
)

crossSbtVersions := List("1.1.0")
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.6")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ class DependenciesDirective(showLicenses: Boolean)(projectIdToDependencies: Stri
for {
r <- graph.roots
d <- children(graph, r)
} {
renderTreeNode(p, graph, d)
}
renderTreeNode(p, graph, d)
p.print("</pre></dd>").println()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,40 @@ object ParadoxDependenciesPlugin extends AutoPlugin {
sbtVersion.value.startsWith("1.1.") || sbtVersion.value.startsWith("1.2.")
},
paradoxDependenciesModuleTrees := Def.taskDyn {
val projectsToFilter = paradoxDependenciesProjects.?.value
.map(inProjects)
.getOrElse {
inAggregates(LocalRootProject, includeRoot = true)
}
val projectsToFilter = paradoxDependenciesProjects.?.value
.map(inProjects)
.getOrElse {
inAggregates(LocalRootProject, includeRoot = true)
}

val filter: ScopeFilter = ScopeFilter(projectsToFilter, inConfigurations(Compile))
val filter: ScopeFilter = ScopeFilter(projectsToFilter, inConfigurations(Compile))

val projectIdWithTree = Def.task {
val sbtGraph = DependencyGraphKeys.moduleGraphSbt.value
(thisProject.value.id, ModuleGraph.apply(sbtGraph.nodes, sbtGraph.edges))
}
val projectIdWithTree = Def.task {
val sbtGraph = DependencyGraphKeys.moduleGraphSbt.value
(thisProject.value.id, ModuleGraph.apply(sbtGraph.nodes, sbtGraph.edges))
}

projectIdWithTree.all(filter).map(_.toMap)
}.value,
projectIdWithTree.all(filter).map(_.toMap)
}.value,
paradoxDirectives ++= Def.taskDyn {
Def.task {
val trees = paradoxDependenciesModuleTrees.value
Seq(
{ _: Writer.Context
new DependenciesDirective(paradoxDependenciesShowLicenses.value)(projectId => {
trees.get(projectId) match {
case Some(deps) => deps
case _ => throw new Error(s"Could not retrieve dependency information for project [$projectId]")
}
})
}
)
}
}.value
Def.task {
val trees = paradoxDependenciesModuleTrees.value
Seq { _: Writer.Context
new DependenciesDirective(paradoxDependenciesShowLicenses.value)(projectId =>
trees.get(projectId) match {
case Some(deps) => deps
case _ => throw new Error(s"Could not retrieve dependency information for project [$projectId]")
}
)
}
}
}.value
)

def dependenciesSettings(config: Configuration): Seq[Setting[_]] =
dependenciesZeroSettings ++ inConfig(config)(
Seq(
// scoped settings here
)
)
Seq(
// scoped settings here
)
)
}

0 comments on commit 0b71eec

Please sign in to comment.