Skip to content

feat(sbt): add SBT (Scala Build Tool) support#752

Open
randomBrainstormer wants to merge 1 commit intortk-ai:developfrom
randomBrainstormer:feat/sbt/add-sbt-scala-build-tool-support
Open

feat(sbt): add SBT (Scala Build Tool) support#752
randomBrainstormer wants to merge 1 commit intortk-ai:developfrom
randomBrainstormer:feat/sbt/add-sbt-scala-build-tool-support

Conversation

@randomBrainstormer
Copy link

@randomBrainstormer randomBrainstormer commented Mar 20, 2026

Summary

  • Adds rtk sbt test — ScalaTest output filtering with 90% token reduction (compact single-line on pass, failure details on fail)
  • Adds rtk sbt compile — strips SBT noise, keeps errors with 75% token reduction (source count + time on success)
  • Adds rtk sbt run — light filtering, strips SBT preamble, passes through program output
  • Adds rtk sbt <other> — passthrough for any unsupported subcommand

Implementation

Follows the established go_cmd.rs pattern:

  • lazy_static! regex for noise/summary/error line detection
  • crate::tee::tee_and_hint for full output recovery on failure
  • Exit code propagation for CI/CD compatibility
  • Discovery rules updated (src/discover/rules.rs) with 80% savings estimate

Test plan

  • 11 unit tests with token savings assertions (>=60% on test pass, >=40% on test fail, >=30% on compile error)
  • 3 real-output fixtures: sbt_test_pass.txt, sbt_test_fail.txt, sbt_compile_error.txt
  • cargo fmt --all --check — clean
  • cargo clippy --all-targets — clean
  • cargo test --all — 990 passed, 0 failed
  • Manual: rtk sbt test in a real Scala project — pending, will validate on a Scala workspace

Documentation

  • README.md — added rtk sbt to build commands section and command rewrite table
  • CHANGELOG.md — added entry under [Unreleased]

Signed-off-by: Ivan Severino 4858703+randomBrainstormer@users.noreply.github.com

Adds `rtk sbt` command with three subcommands:

- `rtk sbt test`    — ScalaTest output filtering (90% token reduction):
                      compact single-line on pass, failure details on fail
- `rtk sbt compile` — Strips SBT noise, keeps errors (75% token reduction):
                      success summary with source count + time
- `rtk sbt run`     — Light filtering, strips SBT preamble, keeps program output
- `rtk sbt <other>` — Passthrough for unsupported subcommands

Implementation follows the established go_cmd.rs pattern with lazy_static
regex, tee output recovery on failure, and exit code propagation for CI/CD.

Includes 3 real-output fixtures (pass, fail, compile error) and 11 unit tests
with token savings assertions. Discovery rules updated with 80% savings estimate.

Signed-off-by: Ivan Severino <4858703+randomBrainstormer@users.noreply.github.com>
@randomBrainstormer randomBrainstormer force-pushed the feat/sbt/add-sbt-scala-build-tool-support branch from fd6de19 to f6c44ec Compare March 20, 2026 16:32
@CLAassistant
Copy link

CLAassistant commented Mar 20, 2026

CLA assistant check
All committers have signed the CLA.

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.

2 participants