Skip to content

Expand Scala tooling detection with Mill, Scala CLI, test frameworks and linters - #226

Merged
andrew merged 1 commit into
git-pkgs:mainfrom
abhinavgautam01:issue-168-expand-scala-tooling
Nov 2, 2026
Merged

andrew merged 1 commit into
git-pkgs:mainfrom
abhinavgautam01:issue-168-expand-scala-tooling

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

Fixes #168

Problem

knowledge/scala/ only covered the language, sbt, ScalaTest, scalafmt and WartRemover. A Mill or Scala CLI project reported Scala but no package manager. A project using MUnit, specs2 or utest reported no test tool. sbt was detected only from a literal build.sbt.

Changes

New tool definitions

Tool Category Signals
Mill package_manager build.mill, build.sc, .mill-version (also applies to Java and Kotlin projects, like Gradle)
Scala CLI package_manager project.scala, with high confidence when it contains //> using
MUnit test "munit" in build.sbt or project/Dependencies.scala, ::munit: or TestModule.Munit in build.mill, build.sc or project.scala
specs2 test "org.specs2" in sbt files, org.specs2:: or TestModule.Specs2 in Mill and Scala CLI files
utest test "utest" in sbt files, ::utest: or TestModule.Utest in Mill and Scala CLI files
Scalafix lint .scalafix.conf or the sbt-scalafix plugin in project/plugins.sbt
Scapegoat lint scapegoat in build.sbt or project/plugins.sbt

sbt

sbt.toml now also detects *.sbt and project/build.properties. That covers builds whose root file has another name and builds defined only under project/.

Notes

  • Stricter matching than plain substrings. Test framework signals match the quoted artifact name ("munit") or the coursier form (::munit:) rather than a bare substring, so text like "community" in a build file comment does not trigger MUnit.
  • Scala CLI uses project.scala only. The knowledge base validator rejects file_contains keys whose file name is a glob, so detecting any *.scala file with a //> using directive is not possible without loosening that rule. project.scala is the conventional Scala CLI configuration file.
  • Extra signals. project/Dependencies.scala is checked for test frameworks because many sbt builds declare dependencies there.

Tests

  • New detect/scala_tools_test.go covers:
    • every new signal through a full scan
    • three fixture projects (mill-project, scala-cli-project, sbt-plugins-project)
    • a near miss where a build with only ScalaTest and a comment naming other frameworks reports none of MUnit, specs2, utest, Mill or Scala CLI
  • README tool lists regenerated with brief list -readme tools.
  • go build ./..., go vet ./..., go test -race ./..., the WebAssembly and WASI builds and golangci-lint run all pass.

@andrew
andrew merged commit e83c96b into git-pkgs:main Nov 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand Scala tooling coverage

2 participants