Support sorting in the list command and add an 'ls' alias - #42
Merged
Conversation
Adds a --sort option to the list command backed by a new ProjectSorter.sortBy method that accepts name, impact, confidence, ease, reach, effort, ice and rice. Omitting --sort keeps the existing creation-order behavior. Registers 'ls' as an alias for 'list'. Closes #29 Closes #34 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
Self-review rubricScored adversarially against the diff and command output, not from judgment alone.
FindingsThree observations are recorded rather than fixed, since each is a judgment call or would widen scope:
Scope disclosure
This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--sort/-soption has been added to thelistcommand. Supported values arename,impact,confidence,ease,reach,effort,iceandrice; matching is case-insensitive.ProjectSorter.sortBy(List<Project>, String)method, so the existing sorting component is reused rather than duplicated.nameis ordered alphabetically (case-insensitive, A to Z); every other key is ordered highest to lowest, matching the existing score-sorting behavior used by theexportcommand.--sortis omitted, projects are still listed in creation order and the header remainsProjects:. When a sort is applied, the header reports it asProjects (sorted by <key>):.ExportProjectsCommand.lshas been registered as an alias forlistvia the@ShellMethodkey array.README.mdhas been updated with the alias, a List Examples block, and the supported sort values. A hardcoded test count inCONTRIBUTING.mdwas found to be stale and has been replaced with a non-brittle statement, since this PR changes that count again.Test plan
./gradlew testpasses locally (78 tests).ProjectSorterTestcovers the newsortBymethod: null list, unsupported key, name ordering, integer-field ordering (impact,effort), RICE ordering, mixed-case keys, original-list immutability, and theisSupportedSortKey/getSupportedSortKeyshelpers.ListProjectsCommandTestcovers creation-order preservation,namesorting,icesorting, case-insensitive keys, rejection of an unsupported key, and registration of thelsalias.ProjectSorterandexportbehavior is untouched; the pre-existingsortByScore/sortByIce/sortByRicetests still pass unchanged.Deferred issues
The remaining open backlog was not selected for this cycle, for the reasons below:
src/main/resources/application.yaml, a path that is gated for human review.build.gradle, a path that is gated for human review.Closes #29
Closes #34
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).