mirror of https://github.com/sbt/sbt.git
[2.x] ci: Add scalafix DisableSyntax.noReturns (#8922)
This commit is contained in:
parent
963acca8ad
commit
14606c593d
|
|
@ -0,0 +1,5 @@
|
|||
rules = [
|
||||
DisableSyntax
|
||||
]
|
||||
|
||||
DisableSyntax.noReturns = true
|
||||
|
|
@ -45,6 +45,7 @@ ThisBuild / scmInfo := Some(
|
|||
)
|
||||
ThisBuild / resolvers += Resolver.mavenLocal
|
||||
ThisBuild / mimaFailOnNoPrevious := false
|
||||
ThisBuild / scalafixOnCompile := true
|
||||
|
||||
Global / semanticdbEnabled := !(Global / insideCI).value
|
||||
// Change main/src/main/scala/sbt/plugins/SemanticdbPlugin.scala too, if you change this.
|
||||
|
|
@ -1022,6 +1023,10 @@ lazy val sbtwProj = (project in file("sbtw"))
|
|||
description := "Windows drop-in launcher for sbt (replaces sbt.bat)",
|
||||
scalaVersion := "3.8.2",
|
||||
crossPaths := false,
|
||||
Compile / scalafix / unmanagedSources := {
|
||||
// https://github.com/scalameta/scalameta/issues/4531
|
||||
(Compile / unmanagedSources).value.filterNot(_.getName == "Main.scala")
|
||||
},
|
||||
Compile / mainClass := Some("sbtw.Main"),
|
||||
libraryDependencies += "com.github.scopt" %% "scopt" % "4.1.0",
|
||||
libraryDependencies += scalaVerify % Test,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ object EditDistance {
|
|||
* Translated from the java version at http://www.merriampark.com/ld.htm which is declared to be
|
||||
* public domain.
|
||||
*/
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
def levenshtein(
|
||||
s: String,
|
||||
t: String,
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ object Escapes extends Properties("Escapes") {
|
|||
(original == removed)
|
||||
}
|
||||
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
def diffIndex(expect: String, original: String): String = {
|
||||
var i = 0;
|
||||
while (i < expect.length && i < original.length) {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ final case class BenchmarkResult(
|
|||
|
||||
object UpdateReportPersistenceBenchmark:
|
||||
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
def run(
|
||||
iterations: Int = 500,
|
||||
configs: Seq[String] = Seq("compile", "test"),
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ object CacheUrlConversion {
|
|||
withForwardSlash
|
||||
}
|
||||
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
def cacheFileToOriginalUrl(fileUrl: String, cacheDir: File): String = {
|
||||
if (!fileUrl.startsWith(FileUrlPrefix)) return fileUrl
|
||||
val filePath = normalizedFilePath(fileUrl)
|
||||
|
|
|
|||
|
|
@ -41,9 +41,11 @@ private[sbt] object IvyUtil {
|
|||
private val _r = """.*HTTP response code: (5\d{2}|408|429).*""".r
|
||||
|
||||
@inline private def check(s: String): Boolean = {
|
||||
if (s == null) return false
|
||||
|
||||
_r.pattern.matcher(s).matches()
|
||||
if (s == null) {
|
||||
false
|
||||
} else {
|
||||
_r.pattern.matcher(s).matches()
|
||||
}
|
||||
}
|
||||
|
||||
def apply(t: Throwable): Boolean = t match {
|
||||
|
|
|
|||
|
|
@ -111,14 +111,17 @@ private[sbt] case class SbtChainResolver(
|
|||
|
||||
/* Copy pasted from `IvyStringUtils` to handle `Throwable` */
|
||||
private def getStackTrace(e: Throwable): String = {
|
||||
if (e == null) return ""
|
||||
val baos = new ByteArrayOutputStream()
|
||||
val printWriter = new PrintWriter(baos)
|
||||
e.printStackTrace(printWriter)
|
||||
printWriter.flush()
|
||||
val stackTrace = new String(baos.toByteArray)
|
||||
printWriter.close()
|
||||
stackTrace
|
||||
if (e == null) {
|
||||
""
|
||||
} else {
|
||||
val baos = new ByteArrayOutputStream()
|
||||
val printWriter = new PrintWriter(baos)
|
||||
e.printStackTrace(printWriter)
|
||||
printWriter.flush()
|
||||
val stackTrace = new String(baos.toByteArray)
|
||||
printWriter.close()
|
||||
stackTrace
|
||||
}
|
||||
}
|
||||
|
||||
/** If None, module was not found. Otherwise, hit. */
|
||||
|
|
|
|||
|
|
@ -516,6 +516,8 @@ private[sbt] final class CommandExchange {
|
|||
private def notifyOtherServers(): Unit = {
|
||||
val thread = new Thread("sbt-notify-other-servers") {
|
||||
setDaemon(true)
|
||||
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
override def run(): Unit = {
|
||||
val procDir = SysProp.globalLocalCache / "proc"
|
||||
if (!procDir.exists) return
|
||||
|
|
|
|||
|
|
@ -240,6 +240,7 @@ private[sbt] object PomGenerator:
|
|||
(scope, optional)
|
||||
|
||||
/** Convert Ivy-style dynamic versions to Maven range format. */
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
private def convertVersion(version: String): String =
|
||||
if version == null then null
|
||||
else if version.endsWith("+") then
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ object Runner:
|
|||
if opts.jvmClient then s = s :+ "--client"
|
||||
s
|
||||
|
||||
@SuppressWarnings(Array("scalafix:DisableSyntax"))
|
||||
def runNativeClient(sbtBinDir: File, scriptPath: String, opts: LauncherOptions): Int =
|
||||
val sbtn = new File(sbtBinDir, "sbtn-x86_64-pc-win32.exe")
|
||||
if !sbtn.isFile then
|
||||
|
|
|
|||
Loading…
Reference in New Issue