Fix lore command index handling and default-command typo - #9
Conversation
- /pl edit and /pl remove now treat lineIndex as 1-based (matching COMMANDS.md/USER_GUIDE.md) instead of indexing 0-based, and validate missing/non-numeric input instead of throwing - DefaultCommand now points players at /pl help instead of the non-existent /lp help - Add JUnit 5 + Mockito as the project's first test dependencies and cover the fixed command paths Closes #7, Closes #8 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
This comment was drafted during a Gardener session (Stephenson-Software/gardener). |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Self-review rubric:
Repo-specific:
No open judgment-call items -- all rubric items pass with direct evidence. This comment was drafted during a Gardener session (Stephenson-Software/gardener). |
|
Holding this PR for manual merge rather than auto-merging: it modifies `pom.xml` (adding `junit-jupiter`/`mockito-core` as test-scope dependencies, plus an explicit `maven-surefire-plugin` version), which is on this repo's do-not-auto-merge list because pom.xml changes affect the shaded JAR/release artifact. The added dependencies are test-scope only (excluded from the shade plugin) so they should not affect the release artifact, but per this skill's own rule a pom.xml match requires human sign-off rather than autonomous merge, regardless of the broader merge pre-authorization for this run. CI is green (https://github.com/Dans-Plugins/PlayerLore/actions/runs/30770764974) and the self-review rubric above passed with no open judgment calls. Ready to merge on approval. This comment was drafted during a Gardener session (Stephenson-Software/gardener). |
Summary
/pl editand/pl removenow treatlineIndexas 1-based, matchingCOMMANDS.md/USER_GUIDE.md, instead of silently indexing 0-based into the lore list (following the documented example -- add one line, then/pl edit 1 ...-- previously threw an uncaughtIndexOutOfBoundsException).ArrayIndexOutOfBoundsException/NumberFormatException.DefaultCommandno longer tells players to type the non-existent/lp help; it now says/pl help, consistent with every other usage string in the plugin andplugin.yml's registered commands (pl,playerlore).EditCommand,RemoveCommand, andDefaultCommand.CHANGELOG.mdunder[Unreleased].Test plan
mvn compile-- cleanmvn test-- 11/11 passingArrayIndexOutOfBounds,NumberFormatException, wrong-index assertions), then restored the fix and confirmed all 11 pass againCOMMANDS.md,USER_GUIDE.md) already described the correct (1-based) behavior -- no doc changes needed, only the code was brought in line with themCloses #7
Closes #8
This PR description was drafted during a Gardener session (Stephenson-Software/gardener).