Skip to content

feat(cli): support file arguments in rs check - #453

Merged
chenjiahan merged 3 commits into
mainfrom
chenjiahan/feat-check-file-arguments
Sep 2, 2026
Merged

feat(cli): support file arguments in rs check#453
chenjiahan merged 3 commits into
mainfrom
chenjiahan/feat-check-file-arguments

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Summary

rs check previously only supported whole-project checks, which prevented callers from scoping the combined lint and format workflow. This PR accepts file and directory arguments, forwards the same scope to both rs lint and rs fmt --check, and preserves option-like file names passed after --. It also updates CLI help, tests, and the English and Chinese documentation.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T12:06:01.638596Z 380cbe5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cca07464fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

);
await runFmtCLI(['--check'], { fixCommand: 'rs fmt', loadedConfig });
await runFmtCLI(['--check', ...fileArgs], {
fixCommand: 'rs fmt',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve selected paths in the formatter fix hint

When rs check <files...> finds a formatting issue, this hard-coded hint tells the user to run unscoped rs fmt; following it formats every configured file, including files deliberately excluded from the check. Build the fix command from the same positional scope, preserving -- and safely quoting paths, so the suggested repair matches the newly scoped workflow.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b2a5d56. The formatter hint now preserves -- and the original file scope, with shell-safe quoting for paths. Tests cover spaces, single quotes, and option-like filenames.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted this fix in 380cbe5. We plan to address the hint together with rs check --fix by telling users to rerun the same command with --fix, which preserves the original file scope without reconstructing shell arguments.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploying rstack-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 380cbe5
Status: ✅  Deploy successful!
Preview URL: https://88e2815d.rstack-cli.pages.dev
Branch Preview URL: https://chenjiahan-feat-check-file-a.rstack-cli.pages.dev

View logs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2a5d564c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rstack/src/cli/commands.ts Outdated
@chenjiahan
chenjiahan merged commit 6cc547b into main Sep 2, 2026
5 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/feat-check-file-arguments branch September 2, 2026 12:17
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.

1 participant