Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
97e8f63 to
6759d09
Compare
6759d09 to
91fdea3
Compare
85ef581 to
be6c318
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Option operands containing -r can suppress valid reports even though raw mode is not enabled.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds the recommended bash/require-read-r rule to prevent read from mangling backslashes.
Changes:
- Implements and registers the autofixable rule.
- Adds unit, integration, and documentation coverage.
- Documents the rule and updates the README.
| File | Description |
|---|---|
src/rules/require-read-r.ts |
Implements detection and autofixing. |
src/rules/require-read-r.spec.ts |
Adds rule tests. |
src/index.ts |
Registers and recommends the rule. |
src/index.spec.ts |
Verifies rule registration. |
tests/autofix.test.ts |
Adds end-to-end autofix coverage. |
docs/rules/require-read-r.md |
Documents behavior and usage. |
README.md |
Adds the rule to the catalog. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (text !== null && /^-[a-zA-Z]*r/u.test(text)) { | ||
| return; |
There was a problem hiding this comment.
Already addressed in 7b4a7d1: the rule now walks read's option clusters with arity, so the operand of -d (separate or attached) is not mistaken for -r. Both read -d -r value and read -dr value are covered as invalid cases. Reviewed and confirmed the suite passes on this branch.
|
@copilot address review comments. Be sure to add tests. |
Fixed in commit |
7b4a7d1 to
777ec05
Compare
dfc7b1a to
d3ee679
Compare
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
d3ee679 to
99a4eeb
Compare

Adds
shell/require-read-r, which mirrors ShellCheck SC2162:readwithout-rtreats backslashes as escapes and mangles input.Behavior
readwhen none of its short-flag arguments before--containsr. Combined flags like-rsand separate flags like-t 5 -rboth count.-rright afterread(read -s pw→read -r -s pw)."error".Documentation
Adds
docs/rules/require-read-r.md, following the format of the@eslint/json,@eslint/css, and@eslint/markdownrule docs: description, background, rule details with incorrect and correct examples, options, when not to use it, and the ShellCheck reference. The rule'smeta.docs.urlpoints at that file, and its README table entry links to it.Testing
verifyAndFixtest intests/autofix.test.ts.284 tests total; build, lint, and format checks pass.
🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬