feat(init/npm): add --yes flag to bypass prompt#31499
feat(init/npm): add --yes flag to bypass prompt#31499dsherret merged 6 commits intodenoland:mainfrom
Conversation
|
Warning Rate limit exceeded@dsherret has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 20 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
WalkthroughThis change introduces a Pre-merge checks and finishing touches✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
cli/args/flags.rs (1)
12537-12705: Init tests updated appropriately; consider a couple more--yescombinationsThe new expectations with
yes: falseand the addeddeno init --yestest align with the parsing changes. For future‑proofing/CI behavior, it could be useful (optional) to add tests for a few extra shapes, for example:
deno init --yes foodeno init foo --yes- Potentially one
--npmcase (for whichever ordering you intend to support)That would lock in the desired behavior around flag/arg ordering for non‑interactive use.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
tests/specs/init/yes_flag/init_lib.outis excluded by!**/*.outtests/specs/init/yes_flag/lib_test.outis excluded by!**/*.out
📒 Files selected for processing (3)
cli/args/flags.rs(14 hunks)cli/tools/init/mod.rs(4 hunks)tests/specs/init/yes_flag/__test__.jsonc(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
tests/specs/**/__test__.jsonc
📄 CodeRabbit inference engine (CLAUDE.md)
Spec tests should be created in
tests/specs/with a__test__.jsoncfile describing test steps and input files
Files:
tests/specs/init/yes_flag/__test__.jsonc
tests/specs/**/{__test__.jsonc,*.out}
📄 CodeRabbit inference engine (CLAUDE.md)
Output assertions in spec tests should use
__test__.jsoncinline fields or.outfiles with special matching syntax:[WILDCARD],[WILDLINE],[WILDCHAR],[WILDCHARS(n)],[UNORDERED_START]/[UNORDERED_END], and[# comment]
Files:
tests/specs/init/yes_flag/__test__.jsonc
cli/tools/**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
CLI tools should be implemented in
cli/tools/<tool>orcli/tools/<tool>/mod.rs
Files:
cli/tools/init/mod.rs
**/*.rs
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.rs: For debugging Rust code, set breakpoints in IDE debuggers (VS Code with rust-analyzer, IntelliJ IDEA) or uselldbdirectly
Useeprintln!()ordbg!()macros for debug prints in Rust code
Files:
cli/tools/init/mod.rscli/args/flags.rs
⚙️ CodeRabbit configuration file
Don't worry about coverage of Rust docstrings. Don't be nitpicky about it. Leave it to the author's judgement if such a documentation is necessary.
Files:
cli/tools/init/mod.rscli/args/flags.rs
cli/args/flags.rs
📄 CodeRabbit inference engine (CLAUDE.md)
CLI flag parsing should be defined in
cli/args/flags.rs
Files:
cli/args/flags.rs
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: denoland/deno PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:19:37.808Z
Learning: Applies to cli/args/flags.rs : CLI flag parsing should be defined in `cli/args/flags.rs`
📚 Learning: 2025-11-24T16:19:37.808Z
Learnt from: CR
Repo: denoland/deno PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:19:37.808Z
Learning: Applies to tests/specs/**/__test__.jsonc : Spec tests should be created in `tests/specs/` with a `__test__.jsonc` file describing test steps and input files
Applied to files:
tests/specs/init/yes_flag/__test__.jsonc
📚 Learning: 2025-11-24T16:19:37.808Z
Learnt from: CR
Repo: denoland/deno PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:19:37.808Z
Learning: Applies to tests/specs/**/{__test__.jsonc,*.out} : Output assertions in spec tests should use `__test__.jsonc` inline fields or `.out` files with special matching syntax: `[WILDCARD]`, `[WILDLINE]`, `[WILDCHAR]`, `[WILDCHARS(n)]`, `[UNORDERED_START]`/`[UNORDERED_END]`, and `[# comment]`
Applied to files:
tests/specs/init/yes_flag/__test__.jsonc
📚 Learning: 2025-11-24T16:19:37.808Z
Learnt from: CR
Repo: denoland/deno PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:19:37.808Z
Learning: Applies to cli/args/flags.rs : CLI flag parsing should be defined in `cli/args/flags.rs`
Applied to files:
cli/args/flags.rs
📚 Learning: 2025-11-24T16:19:37.808Z
Learnt from: CR
Repo: denoland/deno PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:19:37.808Z
Learning: Applies to cli/main.rs : Main CLI entry point is in `cli/main.rs` and should handle command routing
Applied to files:
cli/args/flags.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: lint debug windows-x86_64
- GitHub Check: test release linux-x86_64
- GitHub Check: test debug macos-aarch64
- GitHub Check: test debug linux-aarch64
- GitHub Check: test debug windows-x86_64
- GitHub Check: test debug linux-x86_64
- GitHub Check: lint debug linux-x86_64
- GitHub Check: test debug macos-x86_64
- GitHub Check: lint debug macos-x86_64
- GitHub Check: build libs
🔇 Additional comments (3)
cli/tools/init/mod.rs (1)
33-39: LGTM! Clean refactoring with correct yes-flag logic.The introduction of
InitNpmOptionsproperly groups related parameters, and the conditional prompting logic correctly bypasses interactive confirmation whenyesis true while preserving the existing behavior otherwise.Also applies to: 308-315, 329-353, 375-375
tests/specs/init/yes_flag/__test__.jsonc (1)
1-14: Ensure output assertion files exist.The test spec references
init_lib.outandlib_test.outfor output assertions. Per spec test standards, these.outfiles must exist in the same directory and use the proper matching syntax ([WILDCARD],[WILDLINE],[WILDCHAR],[WILDCHARS(n)],[UNORDERED_START]/[UNORDERED_END]).cli/args/flags.rs (1)
281-289:--yesflag plumbing fordeno initlooks correct; double‑check--npmordering semantics
- Adding
yes: booltoInitFlags, defining-y/--yesoninit_subcommand(), and reading it ininit_parse(including the inner re‑parse for extra args) is consistent with the existing pattern forlib/serveand keeps the defaultfalse.- One subtle behavior to be aware of: because the positional
argsis used to forward flags tonpmwhen--npmis set, calls likedeno init --npm vite --yeswill treat--yesas a package argument (not setInitFlags.yes), whereasdeno init --yes --npm vitewill setyes: true. That mirrors the current--npm vite --servebehavior, but it may be surprising unless documented.If the intent is “only recognize
--yesbefore the package name in--npmmode”, the current wiring is fine; otherwise you may want to adjust or document this explicitly.Also applies to: 3114-3150, 5903-5941
Closes #31498