From ef49a95b7d4321ae6268beadc72aba8ab2a6bf17 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 18 Sep 2018 17:45:24 -0400 Subject: [PATCH] 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 )