Skip to content

feat: accept multiple file paths as positional arguments - #1745

Draft
skoshx wants to merge 3 commits into
mainfrom
cursor/triage-1744-48f3
Draft

feat: accept multiple file paths as positional arguments#1745
skoshx wants to merge 3 commits into
mainfrom
cursor/triage-1744-48f3

Conversation

@skoshx

@skoshx skoshx commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1744

Allows the CLI to accept multiple file paths as positional arguments, enabling CI systems to pass pre-computed changed-file lists directly instead of forcing react-doctor to re-derive them via --scope files --base.

Changes

  • Changed CLI argument from [directory] to [paths...] to accept variadic arguments
  • When multiple paths are provided, they're normalized to repo-relative paths and passed through the same code path as --changed-files-from
  • Maintains full backward compatibility:
    • 0 arguments → scans current directory .
    • 1 argument → scans that directory (existing behavior)
    • N arguments (N > 1) → scans those specific files
  • Added path normalization to handle both relative and absolute paths
  • Updated help examples to show the new usage
  • Added unit tests and e2e tests

Usage

# Scan specific files (new)
react-doctor src/a.tsx src/b.tsx

# Scan current directory (backward compatible)
react-doctor

# Scan specific directory (backward compatible)  
react-doctor ./apps/web

Testing

  • All existing tests pass
  • Added 3 new unit tests for the different argument cases
  • Added e2e tests to verify the feature works correctly
  • Manual testing confirms:
    • Multiple files are scanned correctly
    • Only specified files are scanned (others ignored)
    • Both relative and absolute paths work
    • Backward compatibility maintained

Scope

This is a CLI-only change that doesn't affect the diagnostic engine. The diagnostics produced are identical to using --changed-files-from - we're just adding a more ergonomic way to specify the file list directly on the command line.

Open in Web Open in Cursor 

- Change CLI to accept variadic positional arguments [paths...]
- When multiple paths provided, treat them as file list (like --changed-files-from)
- Maintain backward compatibility: 0 args -> current dir, 1 arg -> directory
- Normalize file paths to repo-relative with forward slashes
- Add tests for all three cases (0, 1, N paths)
- Add example to help output
- Add changeset

Closes #1744

Co-authored-by: Skosh <skoshx@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1745
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1745
npm i https://pkg.pr.new/react-doctor@1745

commit: f23352e

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit f23352e.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at f23352e in a real PTY:

  • selected a project interactively and observed Scanning... before the three-second Git delay completed
  • waited for the clean result and exercised the compact report
  • opened copy context and the GitHub Actions confirmation, then cancelled safely

Download the edited MP4 and PNG evidence

cursoragent and others added 2 commits September 2, 2026 00:33
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
Co-authored-by: Skosh <skoshx@users.noreply.github.com>
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.

Accept a list of file paths, not just one directory

2 participants