test: add shellcheck disable and spec for rtk-rewrite.sh

Merged
SH
8mo ago
+228-0

Summary

  • Add # shellcheck disable=SC2001 to config/claude/rtk-rewrite.sh — the sed patterns use ^ (start-of-string anchor) which bash parameter expansion cannot replicate
  • Add spec/rtk_rewrite_spec.sh with 26 tests covering guards, skip conditions, git/gh/cargo/file/JS/Python/Go rewrites, env prefix preservation, and output format
  • Register rtk-rewrite.sh in spec/coverage_spec.sh coverage list

Test plan

  • make shell-lint passes (0 warnings)
  • make shell-test passes (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.