Skip to content

Commit

Permalink
Various updates
Browse files Browse the repository at this point in the history
* Remove wartremover for lack of Scala3 support
* Update to scala 3.3.3
* Simplify configuration of Scala3 helper
  • Loading branch information
reidspencer committed Mar 5, 2024
1 parent e5ee473 commit 5f82ee3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 49 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,4 @@ addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.11.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "3.1.5")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16")
11 changes: 1 addition & 10 deletions src/main/scala/com/ossuminc/sbt/OssumIncPlugin.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.ossuminc.sbt

import com.ossuminc.sbt.helpers.WartRemover.Keys
import sbt.*
import sbt.Keys.*
import sbt.librarymanagement.Resolver
import wartremover.Wart

object OssumIncPlugin extends AutoPlugin {

Expand Down Expand Up @@ -132,7 +130,6 @@ object OssumIncPlugin extends AutoPlugin {
val scalafmt: ConfigFunc = helpers.Scalafmt.configure
val scoverage: ConfigFunc = helpers.ScalaCoverage.configure
val unidoc: ConfigFunc = helpers.Unidoc.configure
val wartRemover: ConfigFunc = helpers.WartRemover.configure

def noPublishing(project: Project): Project = {
project.settings(
Expand All @@ -150,12 +147,6 @@ object OssumIncPlugin extends AutoPlugin {
)
}

def wartsExcept(excluded: Seq[Wart])(project: Project): Project = {
helpers.WartRemover.configure(project).settings {
Keys.excludedWarts := excluded
}
}

def these(cfuncs: ConfigFunc*)(project: Project): Project = {
cfuncs.foldLeft(project) { (p, func) =>
p.configure(func)
Expand All @@ -173,7 +164,7 @@ object OssumIncPlugin extends AutoPlugin {

def everything(project: Project): Project = {
project.configure(typical)
these(java, misc, build_info, release, wartRemover)(project)
these(java, misc, build_info, release)(project)
}

def native(
Expand Down
21 changes: 14 additions & 7 deletions src/main/scala/com/ossuminc/sbt/helpers/Scala3.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ object Scala3 extends AutoPluginHelper {
"-deprecation",
"-feature",
"-new-syntax",
// "-explain",
// "-explain-types",
"-Werror",
"-pagewidth",
"120"
"-pagewidth:120"
)

def scala_3_doc_options(version: String): Seq[String] = {
Expand All @@ -31,11 +28,21 @@ object Scala3 extends AutoPluginHelper {
)
}

def configure(project: Project): Project = {
def configure(project: Project): Project = Scala3.configure(
Option.empty[String],
Seq.empty[String]
)(project)

def configure(
version: Option[String] = Option.empty[String],
scala3Options: Seq[String] = Seq.empty[String]
)(
project: Project
): Project = {
project
.settings(
scalaVersion := "3.3.1",
scalacOptions := scala_3_options,
scalaVersion := version.getOrElse("3.3.3"),
scalacOptions := scala_3_options ++ scala3Options,
Compile / doc / scalacOptions := scala_3_doc_options((compile / scalaVersion).value),
apiURL := Some(url("https://riddl.tech/apidoc/")),
autoAPIMappings := true
Expand Down
31 changes: 0 additions & 31 deletions src/main/scala/com/ossuminc/sbt/helpers/WartRemover.scala

This file was deleted.

0 comments on commit 5f82ee3

Please sign in to comment.