Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions cmd/fpf/cli_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,10 +802,7 @@ func dynamicReloadManagers(managers []string) []string {

func defaultDynamicReloadManagers(managers []string) []string {

slow := map[string]struct{}{
"flatpak": {},
"npm": {},
}
slow := map[string]struct{}{}
fast := make([]string, 0, len(managers))
for _, manager := range managers {
if _, isSlow := slow[manager]; !isSlow {
Expand Down
8 changes: 4 additions & 4 deletions cmd/fpf/cli_runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ func TestDynamicReloadManagersDefaultAndOverride(t *testing.T) {
allManagers := []string{"apt", "flatpak", "bun", "npm"}

gotDefault := dynamicReloadManagers(allManagers)
if strings.Join(gotDefault, ",") != "apt,bun" {
t.Fatalf("dynamicReloadManagers default=%v want=[apt bun]", gotDefault)
if strings.Join(gotDefault, ",") != "apt,flatpak,bun,npm" {
t.Fatalf("dynamicReloadManagers default=%v want=[apt flatpak bun npm]", gotDefault)
}

t.Setenv("FPF_DYNAMIC_RELOAD_MANAGERS", "all")
Expand All @@ -119,7 +119,7 @@ func TestDynamicReloadManagersDefaultAndOverride(t *testing.T) {

t.Setenv("FPF_DYNAMIC_RELOAD_MANAGERS", "missing,unknown")
gotInvalid := dynamicReloadManagers(allManagers)
if strings.Join(gotInvalid, ",") != "apt,bun" {
t.Fatalf("dynamicReloadManagers invalid override=%v want default fast subset [apt bun]", gotInvalid)
if strings.Join(gotInvalid, ",") != "apt,flatpak,bun,npm" {
t.Fatalf("dynamicReloadManagers invalid override=%v want default fast subset [apt flatpak bun npm]", gotInvalid)
}
}
4 changes: 2 additions & 2 deletions tests/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,10 @@ run_dynamic_reload_manager_parity_no_nested_exec_test() {

assert_not_contains "--feed-search"
assert_contains "apt-cache dumpavail"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,bun"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_contains "bun search rip"
assert_not_contains "flatpak search --columns=application,description rip"
assert_contains "flatpak search --columns=application,description rip"
Comment on lines +1405 to +1408

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Test assertions correctly updated; duplicate assertion on lines 1405-1406.

Lines 1405 and 1406 both assert FPF_IPC_MANAGER_LIST=apt,flatpak,bun. If this duplication is intentional (e.g., checking different fzf invocations), consider adding a comment. Otherwise, remove the redundant line.

The assertion change on line 1408 from assert_not_contains to assert_contains correctly reflects that flatpak is now queried during live typing.

🔧 Remove duplicate assertion if unintentional
     assert_not_contains "--feed-search"
     assert_contains "apt-cache dumpavail"
     assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
-    assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
     assert_contains "bun search rip"
     assert_contains "flatpak search --columns=application,description rip"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_contains "bun search rip"
assert_not_contains "flatpak search --columns=application,description rip"
assert_contains "flatpak search --columns=application,description rip"
assert_fzf_line_contains "FPF_IPC_MANAGER_LIST=apt,flatpak,bun"
assert_contains "bun search rip"
assert_contains "flatpak search --columns=application,description rip"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/smoke.sh` around lines 1405 - 1408, The test contains a duplicated
assertion using assert_fzf_line_contains for
"FPF_IPC_MANAGER_LIST=apt,flatpak,bun" (the two consecutive calls); remove the
redundant assert_fzf_line_contains call (or if both are intentionally checking
different fzf invocations, disambiguate by adding a short comment explaining why
both are needed) and keep the updated assert_contains "flatpak search
--columns=application,description rip" as-is; look for the duplicate calls to
assert_fzf_line_contains in the tests/smoke.sh snippet to make the change.


if grep -Eq '^(dnf|pacman|zypper|emerge|brew|winget|choco|scoop|snap|npm) ' "${LOG_FILE}"; then
printf "Expected reload path to avoid unexpected manager searches\n" >&2
Expand Down
Loading