You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
3.1 KiB

  1. object options {
  2. val scalac = Seq(
  3. // format: off
  4. "-deprecation", // Emit warning and location for usages of deprecated APIs.
  5. "-encoding", "utf-8", // Specify character encoding used by source files.
  6. "-explaintypes", // Explain type errors in more detail.
  7. "-feature", // Emit warning and location for usages of features that should be imported explicitly.
  8. "-language:existentials", // Existential types (besides wildcard types) can be written and inferred
  9. "-language:experimental.macros", // Allow macro definition (besides implementation and application)
  10. "-language:higherKinds", // Allow higher-kinded types
  11. "-language:implicitConversions", // Allow definition of implicit functions called views
  12. "-unchecked", // Enable additional warnings where generated code depends on assumptions.
  13. "-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
  14. "-Xfatal-warnings", // Fail the compilation if there are any warnings.
  15. "-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
  16. "-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
  17. "-Xlint:delayedinit-select", // Selecting member of DelayedInit.
  18. "-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
  19. "-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
  20. "-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
  21. "-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
  22. "-Xlint:nullary-unit", // Warn when nullary methods return Unit.
  23. "-Xlint:option-implicit", // Option.apply used implicit view.
  24. "-Xlint:package-object-classes", // Class or object defined in package object.
  25. "-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
  26. "-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
  27. "-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
  28. "-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
  29. "-Ywarn-dead-code", // Warn when dead code is identified.
  30. "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
  31. "-Ywarn-numeric-widen", // Warn when numerics are widened.
  32. "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
  33. "-Ywarn-unused:imports", // Warn if an import selector is not referenced.
  34. "-Ywarn-unused:locals", // Warn if a local definition is unused.
  35. "-Ywarn-unused:params", // Warn if a value parameter is unused.
  36. "-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
  37. "-Ywarn-unused:privates", // Warn if a private member is unused.
  38. "-Ywarn-value-discard", // Warn when non-Unit expression results are unused.
  39. "-Yrangepos"
  40. // format: on
  41. )
  42. val badScalacConsoleFlags = Seq("-Xfatal-warnings", "-Ywarn-unused:imports")
  43. val scalacConsole = scalac.filterNot(badScalacConsoleFlags.contains(_))
  44. }