Repository navigation
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 55 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (6)
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 |
b2375f1 to
fa0ec7a
Compare
8c9275c to
b9bf917
Compare
b9bf917 to
c1496ac
Compare
c1496ac to
6ab5a1a
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Shell expansion handling currently causes false positives for multi-file expansions and ANSI-C-quoted options.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds the recommended bash/no-useless-cat rule, modeled after ShellCheck SC2002.
Changes:
- Implements and registers the rule.
- Adds rule and plugin tests.
- Adds documentation and README metadata.
| File | Description |
|---|---|
src/rules/no-useless-cat.ts |
Implements pipeline detection. |
src/rules/no-useless-cat.spec.ts |
Adds RuleTester cases. |
src/index.ts |
Registers and recommends the rule. |
src/index.spec.ts |
Verifies rule exposure. |
README.md |
Adds the rules-table entry. |
docs/rules/no-useless-cat.md |
Documents behavior and examples. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@copilot address review comments. Be sure to add tests. |
Added checks for unquoted glob/brace patterns and ANSI-C-quoted arguments, with regression tests. Committed as |
9312963 to
2469abc
Compare
9f3bd79 to
cade9ff
Compare
0c227e0 to
e983fb2
Compare
5844ce2 to
203d0c8
Compare
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule only listed shell/bash in meta.languages, so ESLint rejected it when used with the shell/posix or shell/mksh language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
203d0c8 to
f62c9b8
Compare

Adds
shell/no-useless-cat, which mirrors ShellCheck SC2002:cat file | cmdcan becmd < fileorcmd file.Behavior
catwith exactly one static, non-flag argument and no redirects.catwith several files (a real concatenation).catwith flags (cat -n file | head).cat "$f" | sort.catthat isn't first in a pipeline.cmd < fileorcmd fileis right depends on the command."error".Documentation
Adds
docs/rules/no-useless-cat.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
8 RuleTester cases and 5 documentation checks (279 total); build, lint, and format checks pass.
🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬