From 3e1dac5161abebeb97b849971cc888429588c08c Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 18 Sep 2018 11:47:55 -0400 Subject: [PATCH 1/3] -Xfatal-warnings in most subprojects --- build.sbt | 8 ++++++-- main-actions/src/main/scala/sbt/Package.scala | 1 + .../main/scala/sbt/internal/LibraryManagement.scala | 2 +- main/src/test/scala/sbt/internal/TestBuild.scala | 10 +++++----- project/plugins.sbt | 2 +- sbt/src/test/scala/sbt/RunFromSourceMain.scala | 2 +- .../src/main/scala/sbt/ScriptedPlugin.scala | 1 + 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/build.sbt b/build.sbt index a39721aa0..4fa904754 100644 --- a/build.sbt +++ b/build.sbt @@ -193,6 +193,7 @@ val completeProj = (project in file("internal") / "util-complete") testedBaseSettings, name := "Completion", libraryDependencies += jline, + Compile / scalacOptions += "-Ywarn-unused:-explicits", mimaSettings, // Parser is used publicly, so we can't break bincompat. mimaBinaryIssueFilters := Seq( @@ -221,6 +222,7 @@ lazy val testingProj = (project in file("testing")) baseSettings, name := "Testing", libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value), + Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates", managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", @@ -294,6 +296,7 @@ lazy val runProj = (project in file("run")) .settings( testedBaseSettings, name := "Run", + Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates", managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", @@ -398,10 +401,9 @@ lazy val protocolProj = (project in file("protocol")) .dependsOn(collectionProj) .settings( testedBaseSettings, - scalacOptions -= "-Ywarn-unused", - scalacOptions += "-Xlint:-unused", name := "Protocol", libraryDependencies ++= Seq(sjsonNewScalaJson.value, ipcSocket), + Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates", managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", @@ -443,6 +445,7 @@ lazy val commandProj = (project in file("main-command")) testedBaseSettings, name := "Command", libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi), + Compile / scalacOptions += "-Ywarn-unused:-locals,-explicits,-privates", managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", @@ -546,6 +549,7 @@ lazy val mainProj = (project in file("main")) testedBaseSettings, name := "Main", libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface) ++ log4jDependencies ++ Seq(scalaCacheCaffeine), + Compile / scalacOptions -= "-Xfatal-warnings", managedSourceDirectories in Compile += baseDirectory.value / "src" / "main" / "contraband-scala", sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala", diff --git a/main-actions/src/main/scala/sbt/Package.scala b/main-actions/src/main/scala/sbt/Package.scala index e536c4c05..d91bf524b 100644 --- a/main-actions/src/main/scala/sbt/Package.scala +++ b/main-actions/src/main/scala/sbt/Package.scala @@ -106,6 +106,7 @@ object Package { val inputFiles = conf.sources.map(_._1).toSet val inputs = conf.sources :+: lastModified(inputFiles) :+: manifest :+: HNil cachedMakeJar(inputs)(() => exists(conf.jar)) + () } /** diff --git a/main/src/main/scala/sbt/internal/LibraryManagement.scala b/main/src/main/scala/sbt/internal/LibraryManagement.scala index 612508cc4..4b49c4bbe 100644 --- a/main/src/main/scala/sbt/internal/LibraryManagement.scala +++ b/main/src/main/scala/sbt/internal/LibraryManagement.scala @@ -53,7 +53,7 @@ private[sbt] object LibraryManagement { val finalReport = transform(report) // Warn of any eviction and compatibility warnings - val ew = EvictionWarning(module, ewo, finalReport, log) + val ew = EvictionWarning(module, ewo, finalReport) ew.lines.foreach(log.warn(_)) ew.infoAllTheThings.foreach(log.info(_)) CompatibilityWarning.run(compatWarning, module, mavenStyle, log) diff --git a/main/src/test/scala/sbt/internal/TestBuild.scala b/main/src/test/scala/sbt/internal/TestBuild.scala index a603cd1b7..0fcd546a7 100644 --- a/main/src/test/scala/sbt/internal/TestBuild.scala +++ b/main/src/test/scala/sbt/internal/TestBuild.scala @@ -43,7 +43,7 @@ abstract class TestBuild { implicit val tGen = Arbitrary { genTasks(lowerIDGen, MaxDepsGen, MaxTasksGen) } val seed = rng.Seed.random - final class Keys(val env: Env, val scopes: Seq[Scope]) { + class Keys(val env: Env, val scopes: Seq[Scope]) { override def toString = env + "\n" + scopes.mkString("Scopes:\n\t", "\n\t", "") lazy val delegated = scopes map env.delegates } @@ -119,7 +119,7 @@ abstract class TestBuild { (taskAxes, zero.toSet, single.toSet, multi.toSet) } } - final case class Env(builds: Vector[Build], tasks: Vector[Taskk]) { + case class Env(builds: Vector[Build], tasks: Vector[Taskk]) { override def toString = "Env:\n " + " Tasks:\n " + tasks.mkString("\n ") + "\n" + builds.mkString("\n ") val root = builds.head @@ -159,7 +159,7 @@ abstract class TestBuild { } def getKey: Taskk => AttributeKey[_] = _.key def toConfigKey: Configuration => ConfigKey = c => ConfigKey(c.name) - final case class Build(uri: URI, projects: Seq[Proj]) { + case class Build(uri: URI, projects: Seq[Proj]) { override def toString = "Build " + uri.toString + " :\n " + projects.mkString("\n ") val allProjects = projects map { p => (ProjectRef(uri, p.id), p) @@ -167,7 +167,7 @@ abstract class TestBuild { val root = projects.head val projectMap = mapBy(projects)(_.id) } - final case class Proj( + case class Proj( id: String, delegates: Seq[ProjectRef], configurations: Seq[Configuration] @@ -178,7 +178,7 @@ abstract class TestBuild { val confMap = mapBy(configurations)(_.name) } - final case class Taskk(key: AttributeKey[String], delegates: Seq[Taskk]) { + case class Taskk(key: AttributeKey[String], delegates: Seq[Taskk]) { override def toString = key.label + " (delegates: " + delegates.map(_.key.label).mkString(", ") + ")" } diff --git a/project/plugins.sbt b/project/plugins.sbt index 5ded00d20..3fcf701fe 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,7 @@ scalaVersion := "2.12.6" scalacOptions ++= Seq("-feature", "-language:postfixOps") -addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.7") +addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.8") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.0") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0") diff --git a/sbt/src/test/scala/sbt/RunFromSourceMain.scala b/sbt/src/test/scala/sbt/RunFromSourceMain.scala index 217313c28..e9eead8aa 100644 --- a/sbt/src/test/scala/sbt/RunFromSourceMain.scala +++ b/sbt/src/test/scala/sbt/RunFromSourceMain.scala @@ -118,7 +118,7 @@ object RunFromSourceMain { def globalLock = noGlobalLock def bootDirectory = RunFromSourceMain.bootDirectory def ivyHome = file(sys.props("user.home")) / ".ivy2" - final case class PredefRepo(id: Predefined) extends PredefinedRepository + case class PredefRepo(id: Predefined) extends PredefinedRepository import Predefined._ def ivyRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral)) def appRepositories = Array(PredefRepo(Local), PredefRepo(MavenCentral)) diff --git a/scripted-plugin/src/main/scala/sbt/ScriptedPlugin.scala b/scripted-plugin/src/main/scala/sbt/ScriptedPlugin.scala index 754b3f152..e00e0ef31 100644 --- a/scripted-plugin/src/main/scala/sbt/ScriptedPlugin.scala +++ b/scripted-plugin/src/main/scala/sbt/ScriptedPlugin.scala @@ -8,3 +8,4 @@ package sbt // ScriptedPlugin has moved to main. +private[sbt] object ScriptedPluginNote From 4b23036c63d5e2b98cb246b7d3d66c1cfec979b0 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 18 Sep 2018 16:56:19 -0400 Subject: [PATCH 2/3] contraband 0.4.1 --- project/plugins.sbt | 2 +- .../sbt/internal/langserver/Diagnostic.scala | 18 ++++------- .../langserver/InitializeParams.scala | 2 +- .../langserver/InitializeResult.scala | 2 +- .../langserver/LogMessageParams.scala | 6 ++-- .../sbt/internal/langserver/Position.scala | 4 +-- .../langserver/PublishDiagnosticsParams.scala | 8 +++-- .../sbt/internal/langserver/Range.scala | 4 +-- .../sbt/internal/langserver/SaveOptions.scala | 2 +- .../langserver/ServerCapabilities.scala | 6 ++-- .../langserver/TextDocumentIdentifier.scala | 6 ++-- .../TextDocumentPositionParams.scala | 8 +++-- .../protocol/JsonRpcNotificationMessage.scala | 6 ++-- .../protocol/JsonRpcRequestMessage.scala | 8 +++-- .../protocol/JsonRpcResponseError.scala | 12 +++---- .../protocol/JsonRpcResponseMessage.scala | 12 +++---- .../sbt/internal/protocol/PortFile.scala | 2 +- .../contraband-scala/sbt/ForkOptions.scala | 32 ++++++++----------- .../sbt/protocol/testing/TestItemDetail.scala | 18 +++++------ 19 files changed, 81 insertions(+), 77 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 3fcf701fe..d0a2e5f71 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ scalaVersion := "2.12.6" scalacOptions ++= Seq("-feature", "-language:postfixOps") addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.8") -addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.0") +addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.4.1") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.8.0") addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.15") diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/Diagnostic.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/Diagnostic.scala index 033fae3cf..fb5d9505a 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/Diagnostic.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/Diagnostic.scala @@ -7,23 +7,19 @@ package sbt.internal.langserver /** * Represents a diagnostic, such as a compiler error or warning. * Diagnostic objects are only valid in the scope of a resource. + * @param range The range at which the message applies. + * @param severity The diagnostic's severity. Can be omitted. If omitted it is up to the + client to interpret diagnostics as error, warning, info or hint. + * @param code The diagnostic's code. Can be omitted. + * @param source A human-readable string describing the source of this + diagnostic, e.g. 'typescript' or 'super lint'. + * @param message The diagnostic's message. */ final class Diagnostic private ( - /** The range at which the message applies. */ val range: sbt.internal.langserver.Range, - /** - * The diagnostic's severity. Can be omitted. If omitted it is up to the - * client to interpret diagnostics as error, warning, info or hint. - */ val severity: Option[Long], - /** The diagnostic's code. Can be omitted. */ val code: Option[String], - /** - * A human-readable string describing the source of this - * diagnostic, e.g. 'typescript' or 'super lint'. - */ val source: Option[String], - /** The diagnostic's message. */ val message: String) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeParams.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeParams.scala index 7c53991c0..2c8e5b790 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeParams.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeParams.scala @@ -4,9 +4,9 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver +/** @param rootPath The rootPath of the workspace. */ final class InitializeParams private ( val processId: Option[Long], - /** The rootPath of the workspace. */ val rootPath: Option[String], val rootUri: Option[String], val initializationOptions: Option[sjsonnew.shaded.scalajson.ast.unsafe.JValue], diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeResult.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeResult.scala index a7c797870..e901f03c3 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeResult.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/InitializeResult.scala @@ -4,8 +4,8 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver +/** @param capabilities The capabilities the language server provides. */ final class InitializeResult private ( - /** The capabilities the language server provides. */ val capabilities: sbt.internal.langserver.ServerCapabilities) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/LogMessageParams.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/LogMessageParams.scala index 3755c84d0..a44361697 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/LogMessageParams.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/LogMessageParams.scala @@ -4,10 +4,12 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver +/** + * @param type The message type. + * @param message The actual message + */ final class LogMessageParams private ( - /** The message type. */ val `type`: Long, - /** The actual message */ val message: String) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/Position.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/Position.scala index caf248768..5f07dfb02 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/Position.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/Position.scala @@ -7,11 +7,11 @@ package sbt.internal.langserver /** * Position in a text document expressed as zero-based line and zero-based character offset. * A position is between two characters like an 'insert' cursor in a editor. + * @param line Line position in a document (zero-based). + * @param character Character offset on a line in a document (zero-based). */ final class Position private ( - /** Line position in a document (zero-based). */ val line: Long, - /** Character offset on a line in a document (zero-based). */ val character: Long) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/PublishDiagnosticsParams.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/PublishDiagnosticsParams.scala index 3c18fbbab..1645368f0 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/PublishDiagnosticsParams.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/PublishDiagnosticsParams.scala @@ -4,11 +4,13 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver -/** Diagnostics notification are sent from the server to the client to signal results of validation runs. */ +/** + * Diagnostics notification are sent from the server to the client to signal results of validation runs. + * @param uri The URI for which diagnostic information is reported. + * @param diagnostics An array of diagnostic information items. + */ final class PublishDiagnosticsParams private ( - /** The URI for which diagnostic information is reported. */ val uri: String, - /** An array of diagnostic information items. */ val diagnostics: Vector[sbt.internal.langserver.Diagnostic]) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/Range.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/Range.scala index fab914ef5..99e580c02 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/Range.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/Range.scala @@ -7,11 +7,11 @@ package sbt.internal.langserver /** * A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor. * Therefore the end position is exclusive. + * @param start The range's start position. + * @param end The range's end position. */ final class Range private ( - /** The range's start position. */ val start: sbt.internal.langserver.Position, - /** The range's end position. */ val end: sbt.internal.langserver.Position) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/SaveOptions.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/SaveOptions.scala index 7f66646de..3e08ddd55 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/SaveOptions.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/SaveOptions.scala @@ -4,8 +4,8 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver +/** @param includeText The client is supposed to include the content on save. */ final class SaveOptions private ( - /** The client is supposed to include the content on save. */ val includeText: Option[Boolean]) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/ServerCapabilities.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/ServerCapabilities.scala index 4aa6c698d..ad74d85bc 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/ServerCapabilities.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/ServerCapabilities.scala @@ -4,11 +4,13 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver +/** + * @param hoverProvider The server provides hover support. + * @param definitionProvider Goto definition + */ final class ServerCapabilities private ( val textDocumentSync: Option[sbt.internal.langserver.TextDocumentSyncOptions], - /** The server provides hover support. */ val hoverProvider: Option[Boolean], - /** Goto definition */ val definitionProvider: Option[Boolean]) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentIdentifier.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentIdentifier.scala index dd5a2887f..087f5de2b 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentIdentifier.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentIdentifier.scala @@ -4,9 +4,11 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver -/** Text documents are identified using a URI. On the protocol level, URIs are passed as strings. */ +/** + * Text documents are identified using a URI. On the protocol level, URIs are passed as strings. + * @param uri The text document's URI. + */ final class TextDocumentIdentifier private ( - /** The text document's URI. */ val uri: String) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentPositionParams.scala b/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentPositionParams.scala index 10717f0fc..7b8b5ac53 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentPositionParams.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/langserver/TextDocumentPositionParams.scala @@ -4,11 +4,13 @@ // DO NOT EDIT MANUALLY package sbt.internal.langserver -/** Goto definition params model */ +/** + * Goto definition params model + * @param textDocument The text document. + * @param position The position inside the text document. + */ final class TextDocumentPositionParams private ( - /** The text document. */ val textDocument: sbt.internal.langserver.TextDocumentIdentifier, - /** The position inside the text document. */ val position: sbt.internal.langserver.Position) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcNotificationMessage.scala b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcNotificationMessage.scala index b3edb6b9d..d71caa160 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcNotificationMessage.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcNotificationMessage.scala @@ -4,11 +4,13 @@ // DO NOT EDIT MANUALLY package sbt.internal.protocol +/** + * @param method The method to be invoked. + * @param params The method's params. + */ final class JsonRpcNotificationMessage private ( jsonrpc: String, - /** The method to be invoked. */ val method: String, - /** The method's params. */ val params: Option[sjsonnew.shaded.scalajson.ast.unsafe.JValue]) extends sbt.internal.protocol.JsonRpcMessage(jsonrpc) with Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcRequestMessage.scala b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcRequestMessage.scala index d40611379..7f872728e 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcRequestMessage.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcRequestMessage.scala @@ -4,13 +4,15 @@ // DO NOT EDIT MANUALLY package sbt.internal.protocol +/** + * @param id The request id. + * @param method The method to be invoked. + * @param params The method's params. + */ final class JsonRpcRequestMessage private ( jsonrpc: String, - /** The request id. */ val id: String, - /** The method to be invoked. */ val method: String, - /** The method's params. */ val params: Option[sjsonnew.shaded.scalajson.ast.unsafe.JValue]) extends sbt.internal.protocol.JsonRpcMessage(jsonrpc) with Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseError.scala b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseError.scala index 68541873e..41f939f61 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseError.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseError.scala @@ -4,15 +4,15 @@ // DO NOT EDIT MANUALLY package sbt.internal.protocol +/** + * @param code A number indicating the error type that occurred. + * @param message A string providing a short description of the error. + * @param data A Primitive or Structured value that contains additional + information about the error. Can be omitted. + */ final class JsonRpcResponseError private ( - /** A number indicating the error type that occurred. */ val code: Long, - /** A string providing a short description of the error. */ val message: String, - /** - * A Primitive or Structured value that contains additional - * information about the error. Can be omitted. - */ val data: Option[sjsonnew.shaded.scalajson.ast.unsafe.JValue]) extends Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseMessage.scala b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseMessage.scala index b2d1596b4..79f10013a 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseMessage.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/protocol/JsonRpcResponseMessage.scala @@ -4,16 +4,16 @@ // DO NOT EDIT MANUALLY package sbt.internal.protocol +/** + * @param id The request id. + * @param result The result of a request. This can be omitted in + the case of an error. + * @param error The error object in case a request fails. + */ final class JsonRpcResponseMessage private ( jsonrpc: String, - /** The request id. */ val id: Option[String], - /** - * The result of a request. This can be omitted in - * the case of an error. - */ val result: Option[sjsonnew.shaded.scalajson.ast.unsafe.JValue], - /** The error object in case a request fails. */ val error: Option[sbt.internal.protocol.JsonRpcResponseError]) extends sbt.internal.protocol.JsonRpcMessage(jsonrpc) with Serializable { diff --git a/protocol/src/main/contraband-scala/sbt/internal/protocol/PortFile.scala b/protocol/src/main/contraband-scala/sbt/internal/protocol/PortFile.scala index 8354bc5b4..0798eb284 100644 --- a/protocol/src/main/contraband-scala/sbt/internal/protocol/PortFile.scala +++ b/protocol/src/main/contraband-scala/sbt/internal/protocol/PortFile.scala @@ -7,9 +7,9 @@ package sbt.internal.protocol /** * This file should exist throughout the lifetime of the server. * It can be used to find out the transport protocol (port number etc). + * @param uri URI of the sbt server. */ final class PortFile private ( - /** URI of the sbt server. */ val uri: String, val tokenfilePath: Option[String], val tokenfileUri: Option[String]) extends Serializable { diff --git a/run/src/main/contraband-scala/sbt/ForkOptions.scala b/run/src/main/contraband-scala/sbt/ForkOptions.scala index b8f30ab15..6c5784cb2 100644 --- a/run/src/main/contraband-scala/sbt/ForkOptions.scala +++ b/run/src/main/contraband-scala/sbt/ForkOptions.scala @@ -4,31 +4,27 @@ // DO NOT EDIT MANUALLY package sbt -/** Configures forking. */ +/** + * Configures forking. + * @param javaHome The Java installation to use. If not defined, the Java home for the current process is used. + * @param outputStrategy Configures the forked standard output and error streams. + If not defined, StdoutOutput is used, which maps the forked output to the output of + this process and the forked error to the error stream of the forking process. + * @param bootJars The Vector of jars to put on the forked boot classpath. By default, this is empty. + * @param workingDirectory The directory to use as the working directory for the forked process. + By default, this is the working directory of the forking process. + * @param runJVMOptions The options to prepend to all user-specified arguments. By default, this is empty. + * @param connectInput If true, the standard input of the forked process is connected to the standard input of this process. Otherwise, it is connected to an empty input stream. + Connecting input streams can be problematic, especially on versions before Java 7. + * @param envVars The environment variables to provide to the forked process. By default, none are provided. + */ final class ForkOptions private ( - /** The Java installation to use. If not defined, the Java home for the current process is used. */ val javaHome: Option[java.io.File], - /** - * Configures the forked standard output and error streams. - * If not defined, StdoutOutput is used, which maps the forked output to the output of - * this process and the forked error to the error stream of the forking process. - */ val outputStrategy: Option[sbt.OutputStrategy], - /** The Vector of jars to put on the forked boot classpath. By default, this is empty. */ val bootJars: Vector[java.io.File], - /** - * The directory to use as the working directory for the forked process. - * By default, this is the working directory of the forking process. - */ val workingDirectory: Option[java.io.File], - /** The options to prepend to all user-specified arguments. By default, this is empty. */ val runJVMOptions: Vector[String], - /** - * If true, the standard input of the forked process is connected to the standard input of this process. Otherwise, it is connected to an empty input stream. - * Connecting input streams can be problematic, especially on versions before Java 7. - */ val connectInput: Boolean, - /** The environment variables to provide to the forked process. By default, none are provided. */ val envVars: scala.collection.immutable.Map[String, String]) extends Serializable { private def this() = this(None, None, Vector(), None, Vector(), false, Map()) diff --git a/testing/src/main/contraband-scala/sbt/protocol/testing/TestItemDetail.scala b/testing/src/main/contraband-scala/sbt/protocol/testing/TestItemDetail.scala index 904cdc258..2585091c3 100644 --- a/testing/src/main/contraband-scala/sbt/protocol/testing/TestItemDetail.scala +++ b/testing/src/main/contraband-scala/sbt/protocol/testing/TestItemDetail.scala @@ -4,19 +4,17 @@ // DO NOT EDIT MANUALLY package sbt.protocol.testing -/** Mini version of sbt.testing.Event */ +/** + * Mini version of sbt.testing.Event + * @param fullyQualifiedName The fully qualified name of a class that can rerun the suite or test + about which an event was fired. + * @param status Indicates whether the event represents a test success, failure, error, skipped, ignored, canceled, pending. + * @param duration An amount of time, in milliseconds, that was required to complete the action reported by this event. + None, if no duration was available. + */ final class TestItemDetail private ( - /** - * The fully qualified name of a class that can rerun the suite or test - * about which an event was fired. - */ val fullyQualifiedName: String, - /** Indicates whether the event represents a test success, failure, error, skipped, ignored, canceled, pending. */ val status: sbt.testing.Status, - /** - * An amount of time, in milliseconds, that was required to complete the action reported by this event. - * None, if no duration was available. - */ val duration: Option[Long]) extends Serializable { From ef49a95b7d4321ae6268beadc72aba8ab2a6bf17 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 18 Sep 2018 17:45:24 -0400 Subject: [PATCH 3/3] address more warnings --- build.sbt | 1 - .../sbt/internal/util/appmacro/Instance.scala | 2 +- .../util/complete/ExampleSource.scala | 2 +- .../scala/sbt/internal/util/logic/Logic.scala | 2 +- .../src/main/scala/sbt/Structure.scala | 6 +++--- project/Util.scala | 21 +++++-------------- .../scala/sbt/ConcurrentRestrictions.scala | 2 +- tasks/src/main/scala/sbt/Execute.scala | 2 +- .../scala/sbt/JUnitXmlTestsListener.scala | 2 +- 9 files changed, 14 insertions(+), 26 deletions(-) diff --git a/build.sbt b/build.sbt index 4fa904754..acb87d225 100644 --- a/build.sbt +++ b/build.sbt @@ -193,7 +193,6 @@ val completeProj = (project in file("internal") / "util-complete") testedBaseSettings, name := "Completion", libraryDependencies += jline, - Compile / scalacOptions += "-Ywarn-unused:-explicits", mimaSettings, // Parser is used publicly, so we can't break bincompat. mimaBinaryIssueFilters := Seq( diff --git a/core-macros/src/main/scala/sbt/internal/util/appmacro/Instance.scala b/core-macros/src/main/scala/sbt/internal/util/appmacro/Instance.scala index 4a341e5fd..97cf76288 100644 --- a/core-macros/src/main/scala/sbt/internal/util/appmacro/Instance.scala +++ b/core-macros/src/main/scala/sbt/internal/util/appmacro/Instance.scala @@ -67,7 +67,7 @@ object Instance { * * Each `input` in each expression of the form `wrap[T]( input )` is transformed by `convert`. * This transformation converts the input Tree to a Tree of type `M[T]`. - * The original wrapped expression `wrap(input)` is replaced by a reference to a new local `val $x: T`, where `$x` is a fresh name. + * The original wrapped expression `wrap(input)` is replaced by a reference to a new local `val x: T`, where `x` is a fresh name. * These converted inputs are passed to `builder` as well as the list of these synthetic `ValDef`s. * The `TupleBuilder` instance constructs a tuple (Tree) from the inputs and defines the right hand side of the vals * that unpacks the tuple containing the results of the inputs. diff --git a/internal/util-complete/src/main/scala/sbt/internal/util/complete/ExampleSource.scala b/internal/util-complete/src/main/scala/sbt/internal/util/complete/ExampleSource.scala index 2d3291920..e15217524 100644 --- a/internal/util-complete/src/main/scala/sbt/internal/util/complete/ExampleSource.scala +++ b/internal/util-complete/src/main/scala/sbt/internal/util/complete/ExampleSource.scala @@ -13,7 +13,7 @@ import sbt.io.IO /** * These sources of examples are used in parsers for user input completion. An example of such a source is the - * [[sbt.complete.FileExamples]] class, which provides a list of suggested files to the user as they press the + * [[sbt.internal.util.complete.FileExamples]] class, which provides a list of suggested files to the user as they press the * TAB key in the console. */ trait ExampleSource { diff --git a/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala b/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala index 379681659..246923e77 100644 --- a/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala +++ b/internal/util-logic/src/main/scala/sbt/internal/util/logic/Logic.scala @@ -42,7 +42,7 @@ final case class Clauses(clauses: List[Clause]) { /** When the `body` Formula succeeds, atoms in `head` are true. */ final case class Clause(body: Formula, head: Set[Atom]) -/** A literal is an [[Atom]] or its [[negation|Negated]]. */ +/** A literal is an [[Atom]] or its negation ([[Negated]]). */ sealed abstract class Literal extends Formula { /** The underlying (positive) atom. */ diff --git a/main-settings/src/main/scala/sbt/Structure.scala b/main-settings/src/main/scala/sbt/Structure.scala index 8c4bce77c..3d2b68861 100644 --- a/main-settings/src/main/scala/sbt/Structure.scala +++ b/main-settings/src/main/scala/sbt/Structure.scala @@ -280,13 +280,13 @@ object Scoped { final def set(app: Initialize[S], source: SourcePosition): Setting[S] = setting(scopedKey, app, source) - /** From the given [[Settings]], extract the value bound to this key. */ + /** From the given `Settings`, extract the value bound to this key. */ final def get(settings: Settings[Scope]): Option[S] = settings.get(scopedKey.scope, scopedKey.key) /** - * Creates an [[Def.Initialize]] with value [[scala.None]] if there was no previous definition of this key, - * and `[[scala.Some]](value)` if a definition exists. Useful for when you want to use the ''existence'' of + * Creates an [[Def.Initialize]] with value `scala.None` if there was no previous definition of this key, + * and `scala.Some(value)` if a definition exists. Useful for when you want to use the ''existence'' of * one setting in order to define another setting. * @return currently bound value wrapped in `Initialize[Some[T]]`, or `Initialize[None]` if unbound. */ diff --git a/project/Util.scala b/project/Util.scala index 8a6b4d806..59f1d099e 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -25,25 +25,14 @@ object Util { ) lazy val baseScalacOptions = Seq( - scalacOptions ++= Seq("-Xelide-below", "0"), scalacOptions ++= Seq( - "-encoding", - "utf8", - "-deprecation", - "-feature", - "-unchecked", - "-Xlint", + "-Xelide-below", + "0", "-language:existentials", - "-language:higherKinds", - "-language:implicitConversions", "-language:postfixOps", - "-Xfuture", - "-Yno-adapted-args", - "-Ywarn-dead-code", - "-Ywarn-numeric-widen", - "-Ywarn-unused:-patvars,-implicits,_", - "-Ywarn-unused-import" - ) + ), + Compile / doc / scalacOptions -= "-Xlint", + Compile / doc / scalacOptions -= "-Xfatal-warnings", ) def projectComponent: Setting[_] = diff --git a/tasks/src/main/scala/sbt/ConcurrentRestrictions.scala b/tasks/src/main/scala/sbt/ConcurrentRestrictions.scala index 8b5ac8744..7d0a93461 100644 --- a/tasks/src/main/scala/sbt/ConcurrentRestrictions.scala +++ b/tasks/src/main/scala/sbt/ConcurrentRestrictions.scala @@ -142,7 +142,7 @@ object ConcurrentRestrictions { warn: String => Unit ): CompletionService[A, R] = { - /** Represents submitted work for a task.*/ + // Represents submitted work for a task. final class Enqueue(val node: A, val work: () => R) new CompletionService[A, R] { diff --git a/tasks/src/main/scala/sbt/Execute.scala b/tasks/src/main/scala/sbt/Execute.scala index a607eea53..8dadc56af 100644 --- a/tasks/src/main/scala/sbt/Execute.scala +++ b/tasks/src/main/scala/sbt/Execute.scala @@ -215,7 +215,7 @@ private[sbt] final class Execute[A[_] <: AnyRef]( node, deps, active.toList - /** active is mutable, so take a snapshot */ + /* active is mutable, so take a snapshot */ ) if (active.isEmpty) diff --git a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala index 2ca344984..de18077fd 100644 --- a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala +++ b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala @@ -98,7 +98,7 @@ class JUnitXmlTestsListener(val outputDir: String, logger: Logger) extends Tests val (errors, failures, tests) = (count(TStatus.Error), count(TStatus.Failure), events.size) - /** Junit XML reports don't differentiate between ignored, skipped or pending tests */ + // Junit XML reports don't differentiate between ignored, skipped or pending tests val ignoredSkippedPending = count(TStatus.Ignored) + count(TStatus.Skipped) + count( TStatus.Pending )