feat(config): accept --file wherever --path names a config to write - #11631
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (9)
📝 WalkthroughWalkthroughAdded ChangesConfig target aliases
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ 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 |
Greptile SummaryAdds
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "feat(config): accept --file wherever `--..." | Re-trigger Greptile |
8d0e004 to
ad8b13d
Compare
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Third step of #4881, after #11577 (
use/set) and #11616 (unuse/unset).Five commands name a config file to write to under
--path, and they all declare it identically:mise dotfiles addmise bootstrap packages usemise bootstrap packages importmise bootstrap packages brew tapmise bootstrap packages brew untapEach gains
--fileas a visible alias. It reads as five commands but it is one change repeated five times — splitting it further would be noise rather than caution. The alias is accurate rather than cosmetic: the help already says "config file or directory", and all five resolve throughresolve_target_config_path, the same function behindmise use --path.Generated files
The counts differ on purpose.
mise.usage.kdlgets six lines andman/man1/mise.1gets five, becausedotfiles addis mounted twice — asmise dotfiles addandmise bootstrap dotfiles add— and the kdl carries both mounts while the man page only has aMISE BOOTSTRAP DOTFILES ADDsection.docs/cli/*.mdis unchanged; the markdown generator does not render flag aliases.Tests
Two layers, because these commands are not equally cheap to run.
src/cli/mod.rsgains a clap assertion covering all nine commands done so far.bootstrap packages use/importinstall things anddotfiles addapplies them, so asserting through the parser is the only way to cover them uniformly — and it runs on Windows, where the bash e2e does not. The brew entries are guarded withcfg!(not(windows))since that manager is not registered there.e2e/cli/test_config_target_aliasesgainsbrew tap/untapunder both spellings. Those two only edit[bootstrap.brew.taps]— they do not touch a Homebrew installation, anddefault_tap_urlformats the URL rather than fetching it — so they are the one pair here that can be exercised end to end for free.Remaining
Only
mise config getandmise config setafter this. They are deliberately left out: both take-f --fileand, unlike everything above, accept a file only — the value goes straight toread_to_string/MiseToml::from_filewith no directory branch. Adding--paththere needs that difference stated rather than glossed over, so it belongs in its own change.Summary by CodeRabbit
New Features
--fileas an alias for--pathacross bootstrap configuration commands, including dotfiles, package imports, package use, and Homebrew tap/untap operations.--pathand short-option usage remains supported.Tests