Feature 103/fzf native support #120
No reviewers
Labels
No labels
bug
ci
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
performance
priority
P0
priority
P1
priority
P2
question
refactor
size
L
size
M
size
S
size
XL
size
XS
tests
trivial
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/paso!120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature-103/fzf-native-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
CONTRIBUTING.mdgo test ./... -race) locallygofmt -w .andgolangci-lint run ./...respectivelyREADME.mdif applicableSummary
closes: #103
Informational Warning:
The snapshot tests have been changed.
Please add a screenshot showing what has been changed, and a description of why it was changed.
If you do not provide an explanation and screenshot in 3 days, this PR will be closed.
@TheNoeTrevino
Changed snapshot files (10 files)
internal/testing/snapshots/cli/testdata/help/paso-assignee-pick.goldeninternal/testing/snapshots/cli/testdata/help/paso-assignee.goldeninternal/testing/snapshots/cli/testdata/help/paso-column-pick.goldeninternal/testing/snapshots/cli/testdata/help/paso-column.goldeninternal/testing/snapshots/cli/testdata/help/paso-label-pick.goldeninternal/testing/snapshots/cli/testdata/help/paso-label.goldeninternal/testing/snapshots/cli/testdata/help/paso-project-pick.goldeninternal/testing/snapshots/cli/testdata/help/paso-project.goldeninternal/testing/snapshots/cli/testdata/help/paso-task-pick.goldeninternal/testing/snapshots/cli/testdata/help/paso-task.goldenpick addition is the same for the other entities. diff is actually readable, no ansi
@ -0,0 +30,4 @@return cmd}func runPick(cmd *cobra.Command, args []string) error {Clear DRY violation:
runPickis copy-pasted nearly verbatim across all fivepick.gofiles (assignee,column,label,project,task). The boilerplate — CLI init, defer close, empty-slice check,cli.RunPickcall,fmt.Println(selected)— is identical in every file. Only the service call and title string differ.The project-scoped variant (column, label, task) additionally duplicates the project-ID resolution block. A shared helper — e.g. a generic
runPickWith[T cli.Pickable]function — would eliminate this repetition and give a single place to fix any future changes to the pattern.@ -0,0 +1,66 @@package assigneecli.RunPickcan return errors other than user cancellation (e.g., terminal/rendering failures from the underlying Bubble Tea runtime). Mapping every error to"PICK_CANCELLED"/"Selection cancelled"masks those failures, making them impossible to distinguish from a user pressing Escape.At minimum,
huh.ErrUserAbortedshould be checked explicitly and handled separately from unexpected errors:The same pattern applies to the other four
pick.gofiles.Review summary
Two substantive issues found.
DRY violation (assignee, column, label, project, task pick.go files): The runPick function body is duplicated five times. The only variation across files is the service call, the picker title, and (for project-scoped entities) the project-ID resolution block. All other logic — CLI init, defer close, empty-slice guard, RunPick invocation, fmt.Println — is identical. This should be factored into a shared helper.
Error masking (all five runPick functions): Every error returned by cli.RunPick is reported as "PICK_CANCELLED" / "Selection cancelled", including errors that have nothing to do with the user cancelling. Terminal or rendering errors would produce a misleading message and the wrong exit code classification.
Score: 7/10
@ -0,0 +30,4 @@return cmd}func runPick(cmd *cobra.Command, args []string) error {skipping this