Skip to content

fix: address 10 code TODOs across codebase#215

Merged
chaliy merged 9 commits intomainfrom
claude/address-code-todos-ln4KG
Feb 18, 2026
Merged

fix: address 10 code TODOs across codebase#215
chaliy merged 9 commits intomainfrom
claude/address-code-todos-ln4KG

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 18, 2026

Summary

Addresses 10 TODO/skipped-test items across the codebase, reducing skipped spec tests from 87 to 76 (11 unskipped) and resolving all explicit TODO comments in source code.

Changes by commit:

  1. feat(wc): add -m, -L, --bytes/--lines/--words/--chars flags — Full wc improvement: character count (-m/--chars), max line length (-L), and long flag aliases. Unskips 5 spec tests.

  2. fix(tests): unskip herestring_empty test — The empty herestring correctly produces a newline (bash behavior). Rewrote test to verify via follow-up echo since the spec runner can't represent a bare newline as expected output.

  3. feat(interpreter): implement arithmetic assignment in $(()) — Support VAR = expr inside arithmetic expansion (e.g. $((X = X + 1))). Correctly distinguishes from ==/!=/<=/>=. Unskips arith_assign.

  4. fix(interpreter): propagate exit code from command substitutionx=$(false); echo $? now correctly prints 1. Sets last_exit_code during substitution and preserves it through assignment-only commands.

  5. feat(sort): add -f flag for case-insensitive sorting — Implements fold-case comparison via sort_by_key. Unskips sort_case_insensitive.

  6. fix(tests): unskip uniq -d/-u spec tests — These flags were already implemented in code with passing unit tests but had stale skip markers in spec tests.

  7. chore(interpreter): resolve background execution and shell options TODOs — Replace TODO comments with proper documentation explaining design decisions (background runs synchronously in sandbox; shell options accepted but not enforced).

  8. chore(deny): replace license clarification TODO — Remove unused template placeholder with explanatory comment.

Test plan

  • cargo fmt --check passes
  • cargo clippy --all-targets --all-features -- -D warnings passes
  • cargo test --all-features — all 977+ tests pass, 0 failures
  • All 11 previously-skipped spec tests now pass
  • No regressions in existing tests

Add character count (-m/--chars), max line length (-L/--max-line-length),
and long flag aliases (--bytes, --lines, --words) to the wc builtin.

Refactored flag parsing to properly handle short and long flags.
Unskipped 5 spec tests: wc_chars_m_flag, wc_max_line_length,
wc_long_bytes, wc_bytes_vs_chars, wc_unicode_chars.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
The empty herestring correctly produces a newline (bash behavior).
The test was skipped because the spec runner can't represent a single
newline as expected output. Rewrote test to verify via follow-up echo.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
Support `VAR = expr` syntax inside arithmetic expansion, e.g.
`$((X = X + 1))` evaluates the RHS, assigns to the variable,
and returns the value. Correctly distinguishes assignment (=)
from comparison (==, !=, <=, >=).

Unskipped arith_assign spec test.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
In bash, `x=$(false); echo $?` prints 1 because the exit code of
an assignment-only command is the exit code of the last command
substitution in its value. Previously bashkit always returned 0
for assignment-only commands.

Two changes:
1. Set last_exit_code during command substitution word expansion
2. Use last_exit_code as return code for assignment-only commands

Unskipped subst_exit_code spec test.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
Implement sort -f (fold case) which compares lines case-insensitively
while preserving original casing in output. Uses to_lowercase() for
comparison keys.

Unskipped sort_case_insensitive spec test.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
The uniq -d (only duplicates) and -u (only unique) flags were already
implemented in the Rust code with passing unit tests, but the spec
tests still had stale skip markers. Removed the skip directives and
verified both spec tests pass.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
Replace TODO comments with proper documentation explaining design
decisions:

1. Background execution (&): runs synchronously in virtual mode since
   OS process spawning is excluded from the sandbox by design.

2. Shell options (-e, -x, -v, -u, etc.): documented why each option
   is accepted but not enforced, with specific notes on what
   implementation would require.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
The commented-out [[licenses.clarify]] template with a TODO was a
placeholder that's never been needed. Replace with a clear comment
explaining when clarifications would be added.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
Update spec_tests.rs total from 87 to 76 skipped tests (11 unskipped
in this branch). Fix clippy unnecessary_sort_by lint in sort -f.

https://claude.ai/code/session_016hW1DMEWM7SnaK1n6fZtxk
@chaliy chaliy merged commit c9a8cad into main Feb 18, 2026
15 checks passed
@chaliy chaliy deleted the claude/address-code-todos-ln4KG branch February 18, 2026 00:56
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