Skip to content

crossSbtVersions should be in excludeLintKeys by default #6571

@sjrd

Description

@sjrd

steps

Use the following project/build.properties:

sbt.version=1.5.4

and the following build.sbt:

inThisBuild(Def.settings(
  crossScalaVersions := Seq("2.12.3", "2.10.6"),
  scalaVersion := "2.12.3",

  crossSbtVersions := Seq("1.0.2", "0.13.16"),
))

lazy val `sbt-platform-deps` = project.in(file("."))
  .enablePlugins(SbtPlugin)

Launch sbt

problem

I get the following warning, even though I'm using crossSbtVersions in the most straightforward way:

>sbt
[info] welcome to sbt 1.5.4 (AdoptOpenJDK Java 1.8.0_222)
[info] loading global plugins from C:\Users\sjrdo\.sbt\1.0\plugins
[info] loading settings for project test-sbt-build-build-build from metals.sbt ...
[info] loading project definition from C:\Users\sjrdo\Documents\Projets\test-sbt\project\project\project
[info] loading settings for project test-sbt-build-build from metals.sbt ...
[info] loading project definition from C:\Users\sjrdo\Documents\Projets\test-sbt\project\project
[success] Generated .bloop\test-sbt-build-build.json
[success] Total time: 1 s, completed 30 juin 2021 10:37:25
[info] loading settings for project test-sbt-build from metals.sbt,plugins.sbt ...
[info] loading project definition from C:\Users\sjrdo\Documents\Projets\test-sbt\project
[success] Generated .bloop\test-sbt-build.json
[success] Total time: 1 s, completed 30 juin 2021 10:37:26
[info] loading settings for project sbt-platform-deps from build.sbt ...
[info] set current project to sbt-platform-deps (in build file:/C:/Users/sjrdo/Documents/Projets/test-sbt/)
[warn] there's a key that's not used by any other settings/tasks:
[warn]
[warn] * ThisBuild / crossSbtVersions
[warn]   +- C:\Users\sjrdo\Documents\Projets\test-sbt\build.sbt:7
[warn]
[warn] note: a setting might still be used by a command; to exclude a key from this `lintUnused` check
[warn] either append it to `Global / excludeLintKeys` or call .withRank(KeyRanks.Invisible) on the key
[info] sbt server started at local:sbt-server-938ab732c0021a117f13
[info] started sbt server
sbt:sbt-platform-deps>

expectation

I expect no warning about the standard way of using crossSbtVersions.

workaround

Add the following to build.sbt:

Global / excludeLintKeys += crossSbtVersions

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions