feat(sbt): add SBT (Scala Build Tool) support#752
Conversation
fd6de19 to
f6c44ec
Compare
|
Hey We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes No logic changes — only file moves and import path updates. What you need to doRebase your branch on git fetch origin && git rebase origin/developGit detects renames automatically. If you get import conflicts, update the paths: use crate::git; // now: use crate::cmds::git::git;
use crate::tracking; // now: use crate::core::tracking;
use crate::config; // now: use crate::core::config;
use crate::init; // now: use crate::hooks::init;
use crate::gain; // now: use crate::analytics::gain;Need help rebasing? Tag @aeppling |
f6c44ec to
c985d7b
Compare
|
Hey, thanks for the heads-up! @aeppling , I've rebased on |
f7dc838 to
10ff209
Compare
f650ab6 to
86c89f5
Compare
86c89f5 to
1722d50
Compare
|
hey @aeppling any update on this ? do you think it can be merged ? |
|
Please merge before my wallet getting empty due to our scala project :D |
|
Hi @randomBrainstormer! Re-ran CI on the rebased branch and it hit two regressions from
Could you push a quick fix? After that CI should go green and we can merge. Full job log: https://github.com/rtk-ai/rtk/actions/runs/24583551517/job/76078806371 |
2b89d93 to
b360283
Compare
|
@pszymkowiak Done! Rebased onto develop and pushed a fix for both:
CI should be green now. Let me know if anything else comes up before merge. |
|
Thanks for the quick rebase fix — CI is green now (verified, 11 checks pass on all 3 OS). I built the branch and tested
Two suggestions:
Minor:
|
|
@pszymkowiak good catch on munit , it's the default in Scala 3 templates so definitely not an edge case. Fix was small enough to fold in here:
|
7619c61 to
327a4e1
Compare
|
@pszymkowiak hey, just checking in — munit fix is in, CI is green. Any blockers on your end before this can be merged? |
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>
…dle Mockito/ScalaMock - filter_sbt_test now uses a state machine to capture [info] detail lines that follow a *** FAILED *** marker — covers native ScalaTest assertion messages, Mockito Scala verification failures (WantedButNotInvoked, TooManyActualInvocations), and ScalaMock expectation failures (Unexpected call, Unsatisfied expectation) - run_other detects integration test commands (it:test, IntegrationTest/test, integration-test/test, and any *:test / */test variant) and applies filter_sbt_test instead of raw passthrough - sbt boilerplate cleaned from failure output: TestsFailedException, Total time, and compileIncremental noise removed; failed suite class names retained for navigation - add fixtures: sbt_test_mockito_fail.txt, sbt_test_scalamock_fail.txt, sbt_it_test_pass.txt - 18 tests (was 11), all passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…quirement Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add MUNIT_SUMMARY_RE to recognize the munit/discipline-munit summary format: [info] Passed: Total N, Failed N, Errors N, Passed N [info] Failed: Total N, Failed N, Errors N, Passed N munit is the default test framework in Scala 3 templates and is used by major libraries (typelevel/cats via discipline-munit). Without this, filter_sbt_test fell through to the error-recovery path for every munit project, which also printed a misleading "sbt test: parse error" header. Changes: - Add MUNIT_SUMMARY_RE regex and parse branch in filter_sbt_test - Change fallback label from "sbt test: parse error" to "sbt test: errors" - Add munit pass/fail fixtures and tests covering both Scala 2 (ScalaTest) and Scala 3 (munit) output formats
f272aee to
189409b
Compare
|
Thanks for this PR! I am a heavy Scala/SBT user and would really like to finally get this feature. |
|
Hi @pszymkowiak @aeppling , bumping this one. All your review points are addressed (munit fix in, last CI green). Anything still blocking, or is it good to merge? |
…cala-build-tool-support # Conflicts: # src/main.rs
Summary
rtk sbt test— ScalaTest output filtering with 90% token reduction (compact single-line on pass, failure details on fail)rtk sbt compile— strips SBT noise, keeps errors with 75% token reduction (source count + time on success)rtk sbt run— light filtering, strips SBT preamble, passes through program outputrtk sbt <other>— passthrough for any unsupported subcommandImplementation
Follows the established
go_cmd.rspattern:lazy_static!regex for noise/summary/error line detectioncrate::tee::tee_and_hintfor full output recovery on failuresrc/discover/rules.rs) with 80% savings estimateTest plan
sbt_test_pass.txt,sbt_test_fail.txt,sbt_compile_error.txtcargo fmt --all --check— cleancargo clippy --all-targets— cleancargo test --all— 990 passed, 0 failedrtk sbt testin a real Scala project — pending, will validate on a Scala workspaceDocumentation
README.md— addedrtk sbtto build commands section and command rewrite tableCHANGELOG.md— added entry under[Unreleased]Signed-off-by: Ivan Severino 4858703+randomBrainstormer@users.noreply.github.com