Merge pull request #5985 from xirc/use-lint-xxx-filter-in-test

Use lint***Filter instead of ***LintKeys for more reliable tests
This commit is contained in:
eugene yokota 2020-10-18 14:01:17 -04:00 committed by GitHub
commit 2f7cc6e9e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -2,14 +2,18 @@ ThisBuild / doc / scalacOptions += "-Xsomething"
ThisBuild / shellPrompt := { state => "sbt> " }
// watch related settings
ThisBuild / sbt.nio.Keys.watchTriggers := Seq()
ThisBuild / sbt.nio.Keys.watchPersistFileStamps := true
lazy val lintBuildTest = taskKey[Unit]("")
lazy val root = (project in file("."))
.settings(
lintBuildTest := {
val state = Keys.state.value
val includeKeys = (includeLintKeys in Global).value map { _.scopedKey.key.label }
val excludeKeys = (excludeLintKeys in Global).value map { _.scopedKey.key.label }
val includeKeys = (lintIncludeFilter in Global).value
val excludeKeys = (lintExcludeFilter in Global).value
val result = sbt.internal.LintUnused.lintUnused(state, includeKeys, excludeKeys)
result foreach {
case (_, "ThisBuild / doc / scalacOptions", _) => ()