fix(rewrite): handle tail/head -n<N> joined flag form#1180
Closed
1llum1n4t1s wants to merge 1 commit into
Closed
Conversation
Collaborator
📊 Automated PR Analysis
SummaryFixes tail and head command rewrite patterns to handle the joined flag form (e.g., Review Checklist
Linked issues: #1108 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
f76b2ac to
f57897a
Compare
f57897a to
9a36178
Compare
The hook rewrite regex missed `tail -n20` and `head -n20` (no space between -n and the number). Also adds missing `head -n` and `head --lines <N>` (space-separated) patterns that were only implemented for tail. Closes #1108 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9a36178 to
0209b08
Compare
Author
|
Closing this PR as it doesn't look like it'll be merged. Feel free to reopen if there's interest. Thanks! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tail -n20 file(no space between-nand number) not being rewritten tortk read file --tail-lines 20head -n 20,head -n20, andhead --lines 20rewrite patterns (onlyhead -20andhead --lines=20were supported)Root Cause
The
TAIL_N_SPACEregex required a mandatory space between-nand the digit (\s+), sotail -n20fell through unmatched. Forhead, the-nand--lines <space>forms were never implemented at all.Test plan
cargo test test_rewrite_tail— 7 tests passcargo test test_rewrite_head— 7 tests passcargo fmt && cargo clippy --all-targets && cargo test --all— 1357 tests pass, 0 failuresCloses #1108
🤖 Generated with Claude Code