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 59 minutes. View limit details
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 |
8764821 to
efd8304
Compare
efd8304 to
553fdfc
Compare
160d71e to
7662f4e
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The recommended autofix interaction can silence the new rule while changing loop behavior.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds the bash/no-ls-iteration rule to detect fragile iteration over ls output.
Changes:
- Implements and tests SC2045-style detection.
- Enables the rule in the recommended configuration.
- Adds rule documentation and README registration.
| File | Description |
|---|---|
src/rules/no-ls-iteration.ts |
Implements the rule. |
src/rules/no-ls-iteration.spec.ts |
Adds rule tests. |
src/index.ts |
Registers and enables the rule. |
src/index.spec.ts |
Verifies rule registration. |
README.md |
Adds the rule to the catalog. |
docs/rules/no-ls-iteration.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. |
Addressed in commit |
f7c9598 to
a7a4c99
Compare
81a81b1 to
d41d6b2
Compare
d41d6b2 to
c021333
Compare
c021333 to
91cf318
Compare
91cf318 to
9cd7af7
Compare
9cd7af7 to
b58e27b
Compare
0d0c411 to
a7458b2
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>
Add section headers and an @author tag to the fileoverview comment of each source file to match the conventions used in other ESLint language plugins. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a7458b2 to
133bc25
Compare


Adds
shell/no-ls-iteration, which mirrors ShellCheck SC2045:for f in $(ls)breaks on filenames with spaces or glob characters; use a glob instead.Behavior
for ... inword list whose first statement isls, or a pipeline that starts withls($(ls | grep log)). Both$(...)and backticks are checked.$(find ...), andlsoutside aforword list. ShellCheck's broader "parsing ls output" check, SC2012, isn't covered.lsflags and arguments."error".Documentation
Adds
docs/rules/no-ls-iteration.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
9 RuleTester cases and 5 documentation checks (259 total); build, lint, and format checks pass.
🤖 Generated with Claude Code
Stack created with GitHub Stacks CLI • Give Feedback 💬