test: add shellcheck disable and spec for rtk-rewrite.sh
Merged
SH
8mo ago+228+228+012345678901234567890123456789-0-0-0123456789
Summary
- Add
# shellcheck disable=SC2001toconfig/claude/rtk-rewrite.shā the sed patterns use^(start-of-string anchor) which bash parameter expansion cannot replicate - Add
spec/rtk_rewrite_spec.shwith 26 tests covering guards, skip conditions, git/gh/cargo/file/JS/Python/Go rewrites, env prefix preservation, and output format - Register
rtk-rewrite.shinspec/coverage_spec.shcoverage list
Test plan
-
make shell-lintpasses (0 warnings) -
make shell-testpasses (523 examples, 0 failures)
š¤ Generated with Claude Code
Summary by cubic
Allow sed-based rewrite patterns in rtk-rewrite.sh and add a comprehensive spec to lock down behavior. Suppresses a false shellcheck warning, expands coverage, keeps CI passing, and formats the new spec.
-
Bug Fixes
- Disable shellcheck SC2001 in rtk-rewrite.sh.
- Mock the rtk binary in the spec to avoid guard exits in CI.
- Format rtk_rewrite_spec.sh for consistency.
-
New Features
- Add spec/rtk_rewrite_spec.sh with 26 tests for guards, skip conditions, rewrites (git, gh, cargo, file ops, JS/TS, Python, Go), env var preservation, and JSON output.
- Register rtk-rewrite.sh in spec/coverage_spec.sh.