From 1193f44be26b7b029de880d71355745d09feca25 Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Sun, 18 Oct 2020 18:20:23 +0900 Subject: [PATCH] Use lint***Filter instead of ***LintKeys for more reliable test Below functions pass lintIncludeFilter and lintExcludeFilter to lintUnusedinstead of includeLintKeys and excludeLintKeys respectively. - sbt.internal.LintUnused#lintUnusedTask - sbt.internal.LintUnused#lintUnusedFunc Therefore, in the test, we had better to use lint***Filter instead of ***LintKeys. --- sbt/src/sbt-test/project/lint/build.sbt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sbt/src/sbt-test/project/lint/build.sbt b/sbt/src/sbt-test/project/lint/build.sbt index 9ee3171f6..b8ba55e05 100644 --- a/sbt/src/sbt-test/project/lint/build.sbt +++ b/sbt/src/sbt-test/project/lint/build.sbt @@ -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", _) => ()