fix: flag completions install for shells that will not load the file - #1082
Conversation
`min completions install` wrote each shell's file and exited 0 with no check that the shell would ever source it. `install_one` now guards the two shells whose written path is not self-sufficient: - bash has no completion search path of its own; the file is read only by the separate bash-completion project's loader. When no loader is found on the system, skip bash with a warning rather than leave an inert file. - zsh autoloads the file only when its directory is on `$fpath` before `compinit`. When that cannot be confirmed, print the `fpath+=(...)` line the user needs. fish is unaffected: its XDG completions path is native.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 54 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Fixes #1027
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmglFQ
min completions installwrote each shell's file and returned success without checking the shell would ever load it.install_onenow guards the two shells whose target path is not self-sufficient: bash is skipped with a warning when no bash-completion loader (the only reader of~/.local/share/bash-completion/completions) is found on the system, and zsh emits thefpath+=(...)line the user needs when its completions dir cannot be confirmed on$fpath. fish is untouched (native XDG path). This follows the module's existing "warn on stderr, not fail" convention for shell dirs (informed by #714).Verification
cargo fmt --all --check --manifest-path target/Cargo.toml— cleancargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warnings— 0 warningscargo build --workspace --locked --manifest-path target/Cargo.toml— Finished, okcargo test --workspace --locked --manifest-path target/Cargo.toml— all passed (minimal crate 134/134; newfpath_membership_is_exactgreen)Note
Block shell completion install when no bash-completion loader is detected
install_onewith an error if no bash-completion loader is found (checksBASH_COMPLETION_USER_DIRenv var and seven standard loader paths); previously the file would be written silently with no loader to source it.$fpath, advising the user to update~/.zshrcbeforecompinit.bash_completion_present,zsh_dir_on_fpath, andfpath_containshelpers in completions.rs with unit tests for path membership.Macroscope summarized 1135f2e.