Skip to content

Commit

Permalink
Merge pull request #211 from scala-steward/update/scalafmt-core-3.0.8
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.0.8
  • Loading branch information
Atry authored Nov 3, 2021
2 parents f88f78f + 8a09d9b commit 21bad16
Show file tree
Hide file tree
Showing 33 changed files with 92 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "2.7.5"
version = "3.0.8"
maxColumn = 120
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package com.thoughtworks.sbtBestPractice.detectLicense
import sbt.Keys._
import sbt._

/**
* Determine if this project is licensed under Apache License 2.0
/** Determine if this project is licensed under Apache License 2.0
*/
object ApacheLicense extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.thoughtworks.sbtBestPractice.detectLicense
import sbt.Keys._
import sbt._

/**
* @author 杨博 (Yang Bo) <[email protected]>
/** @author
* 杨博 (Yang Bo) <[email protected]>
*/
object MitLicense extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import sbt.plugins.CorePlugin

import scala.collection.JavaConverters._

/**
* Detect GIT directories from git log
/** Detect GIT directories from git log
*/
object Git extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import sbt.Keys._
import sbt._
import scala.collection.JavaConverters._

/**
* Fill developers from git log
/** Fill developers from git log
*/
object GitDevelopers extends AutoPlugin {

Expand All @@ -26,10 +25,12 @@ object GitDevelopers extends AutoPlugin {
commit <- git.log().call().asScala
} yield {
val author = commit.getAuthorIdent
Developer("",
author.getName,
author.getEmailAddress,
new java.net.URL("mailto", null, author.getEmailAddress))
Developer(
"",
author.getName,
author.getEmailAddress,
new java.net.URL("mailto", null, author.getEmailAddress)
)
}).toSet
} finally {
git.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt.plugins.JvmPlugin
import sbt._
import Keys._

/**
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
/** @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object GithubActionsDocTitle extends AutoPlugin {
override def requires: Plugins = GithubActionsEnvironmentVariables && JvmPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package com.thoughtworks.sbtBestPractice.githubActions
import sbt._
import com.thoughtworks.dsl.keywords.Yield

/**
* Configure sbt settings of environment variables from Github Actions
/** Configure sbt settings of environment variables from Github Actions
*
* @note This plugin should only be enabled when sbt is running on Github Actions
* @note
* This plugin should only be enabled when sbt is running on Github Actions
*
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
* @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object GithubActionsEnvironmentVariables extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package com.thoughtworks.sbtBestPractice.githubActions
import sbt.Keys._
import sbt._

/**
* Fill project information from Github Actions environment variables
/** Fill project information from Github Actions environment variables
*/
object GithubActionsHomepage extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt._
import org.scalajs.sbtplugin.ScalaJSPlugin
import scala.language.reflectiveCalls

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object GithubActionsScalaJs extends AutoPlugin {
private def reflectiveLinkerSetting[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import sbt.{Node => _, _}
import sbt.nio.file.FileTreeView
import com.thoughtworks.Extractor._

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object GithubActionsScalaVersions extends AutoPlugin {
override def requires = JvmPlugin && Git
Expand All @@ -27,9 +27,8 @@ object GithubActionsScalaVersions extends AutoPlugin {
)

private implicit final class YamlPathOps(private val nodes: Seq[Node]) extends AnyVal {
private def keyValue: PartialFunction[NodeTuple, (Node, Node)] = {
case tuple =>
(tuple.getKeyNode(), tuple.getValueNode())
private def keyValue: PartialFunction[NodeTuple, (Node, Node)] = { case tuple =>
(tuple.getKeyNode(), tuple.getValueNode())
}

def childNodes(key: String): Seq[Node] = {
Expand All @@ -47,9 +46,8 @@ object GithubActionsScalaVersions extends AutoPlugin {
def childNodes: Seq[Node] = {
nodes.flatMap {
case mappingNode: MappingNode =>
mappingNode.getValue().asScala.collect {
case keyValue.extract(_, value) =>
value
mappingNode.getValue().asScala.collect { case keyValue.extract(_, value) =>
value
}
case sequence: SequenceNode =>
sequence.getValue().asScala
Expand Down Expand Up @@ -82,9 +80,8 @@ object GithubActionsScalaVersions extends AutoPlugin {
.childNodes("matrix")
.childNodes("scala")
.childNodes
.collect {
case scalarNode: ScalarNode =>
scalarNode.getValue()
.collect { case scalarNode: ScalarNode =>
scalarNode.getValue()
}
} finally {
reader.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import org.eclipse.jgit.lib.Constants
import sbt.Keys._
import sbt._

/**
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
/** @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object GithubActionsScaladocSourceUrl extends AutoPlugin {
override def requires: Plugins = GithubActionsEnvironmentVariables && GitPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import sbt.Keys.projectID
import sbt.{AutoPlugin, Def, ModuleID}
import sbtdynver.DynVerPlugin

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object MimaPreviousVersion extends AutoPlugin {

Expand All @@ -22,7 +22,7 @@ object MimaPreviousVersion extends AutoPlugin {
mimaPreviousArtifacts ++= {
val currentModuleID = projectID.value.withExplicitArtifacts(Vector.empty)
previousStableVersion.value.map(currentModuleID.withRevision).toSet: Set[ModuleID]
},
}
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.typesafe.tools.mima.plugin.MimaPlugin
import sbt.Keys._
import sbt._

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object MimaSkip extends AutoPlugin {

Expand All @@ -25,7 +25,7 @@ object MimaSkip extends AutoPlugin {
} else {
Def.task(default.value)
}
}.value,
}.value
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.typesafe.tools.mima.plugin.MimaPlugin
import sbt._
import sbt.Keys._

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object MimaTest extends AutoPlugin {

Expand All @@ -19,7 +19,7 @@ object MimaTest extends AutoPlugin {
Test / test := {
mimaReportBinaryIssues.value
(Test / test).value
},
}
)

}
1 change: 0 additions & 1 deletion project/mavenResolvers.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
resolvers += Resolver.sonatypeRepo("staging")

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import sbt.Defaults.{packageDocMappings, packageTaskSettings}
import sbt.plugins.JvmPlugin
import sbtunidoc.UnidocKeys

/**
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
/** @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object PackageUnidoc extends AutoPlugin with UnidocKeys {

Expand All @@ -17,7 +17,8 @@ object PackageUnidoc extends AutoPlugin with UnidocKeys {

object autoImport {
val unidocProject = settingKey[Option[ProjectRef]](
"The project that defines a unidoc task. If this `unidocProject` setting is not None, packageDoc will use files generated from unidoc instead of per project doc")
"The project that defines a unidoc task. If this `unidocProject` setting is not None, packageDoc will use files generated from unidoc instead of per project doc"
)
}
import autoImport._

Expand All @@ -35,7 +36,8 @@ object PackageUnidoc extends AutoPlugin with UnidocKeys {
case Some(p) => (unidoc in Compile in p).map(_.flatMap(Path.allSubpaths))
}
}
))
)
)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object UnidocProject extends AutoPlugin {
override def requires: Plugins = BaseUnidocPlugin

override def projectSettings = Seq(
PackageUnidoc.autoImport.unidocProject in ThisBuild := Some(thisProjectRef.value),
PackageUnidoc.autoImport.unidocProject in ThisBuild := Some(thisProjectRef.value)
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt.Keys.scalacOptions
import sbt._
import sbt.plugins.JvmPlugin

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object CheckInit extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt._
import Keys._
import sbt.plugins.JvmPlugin

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object ClasspathCache extends AutoPlugin {
override def trigger = allRequirements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import sbt.{Def, _}
import sbt.Keys._
import sbt.plugins.JvmPlugin

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object Optimization extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import sbt.Keys._
import sbt._
import sbt.plugins.JvmPlugin

/**
* Enable scalac warnings
/** Enable scalac warnings
*/
object ScalacWarnings extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt._
import sbt.Keys._
import sbt.plugins.JvmPlugin

/**
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
/** @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object ScaladocFeatures extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt._
import sbt.Keys._
import sbt.plugins.JvmPlugin

/**
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
/** @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object ScaladocTitle extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import sbt.{AutoPlugin, Def}

/** Skip duplicate publish.
*
* If cross paths are disabled, then publish will be skipped,
* unless current scala version is the same as the first cross scala version.
* If cross paths are disabled, then publish will be skipped, unless current scala version is the same as the first
* cross scala version.
*
* @author 杨博 (Yang Bo)
* @author
* 杨博 (Yang Bo)
*/
object SkipDuplicateJavaPublish extends AutoPlugin {
override def trigger = allRequirements
Expand Down
1 change: 1 addition & 0 deletions subdirectory-organization/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import sbt.Keys._
import sbt._
import scala.collection.JavaConverters._

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object SubdirectoryOrganization extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package com.thoughtworks.sbtBestPractice.travis
import sbt.Keys._
import sbt._

/**
* Fill project informations from Travis environment variables
/** Fill project informations from Travis environment variables
*/
object DetectHomepageFromTravisEnvironmentVariables extends AutoPlugin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import sbt.Keys.crossScalaVersions
import sbt.plugins.JvmPlugin
import sbt.{Node => _, _}

/**
* @author 杨博 (Yang Bo)
/** @author
* 杨博 (Yang Bo)
*/
object DetectScalaVersionsFromTravisYml extends AutoPlugin {
override def requires = JvmPlugin && Git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import org.eclipse.jgit.lib.Constants
import sbt.Keys._
import sbt._

/**
* @author 杨博 (Yang Bo) &lt;[email protected]&gt;
/** @author
* 杨博 (Yang Bo) &lt;[email protected]&gt;
*/
object ScaladocSourceUrl extends AutoPlugin {
override def requires: Plugins = Travis && GitPlugin
Expand Down
Loading

0 comments on commit 21bad16

Please sign in to comment.