Repository navigation
Give hub city-still --width/--height a one-line range error - #257
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review: no blocking findings. The
This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
gardener hub city-still --width/--heightwere declared withchoices=range(320, 4097)/choices=range(180, 4097). argparse's invalid-choice error lists every choice, so--width 5000printed roughly 22 KB of comma-separated numbers (measured with the sameadd_argumentcall under argparse: 22,071 bytes) instead of naming the range. Both flags now use range-checkedtype=callables,city_widthandcity_heightingardener/cli.py, which follow the existingport_arg/city_hourspattern and raise a one-lineArgumentTypeErrorsuch asmust be a whole number of pixels from 320 to 4096, got: '5000'. The accepted ranges and defaults are unchanged.--help, and each now has one that states its range and default.docs/HUB.md's command table row forhub city-stillnow lists--weather-sample, whichdocs/USAGE.mdand HUB.md's own "Weather" section already document.docs/TESTING.md'stest_cli.pyparagraph names the new argparse types alongside the others.The problem was not tracked in an issue; it was found during the cycle's triage scan for unhelpful error messages. No open issue was picked up because all four (#248, #154, #100, #94) are waiting on a maintainer decision.
Test plan
python3 -m compileall gardenerTestCityStillSizeintests/test_cli.py: in-range values accepted at both ends, out-of-range and non-integer values rejected, parse-time exit 2 with an error under 1,000 characters that names4096, and defaults (1280×720) kept.gardener/cli.pyrestored fromorigin/main(and a check thatdef city_widthoccurs 0 times), the new class failed. With the fix restored, all 4 tests passed andgit diffwas empty.tests/and theintegration/offline tier on Python 3.10 and the latest 3.x) is the anchor of record for this PR. The local run was only partial: the sandbox'spython3is 3.8, belowrequires-python, sotests.test_cliwas run through an in-memory import shim kept outside the repo. That run had 339 tests, and the 13 errors in it come from the shim's own rewriting of module constants. None of them are in the new class.dispatch.py,dev_loop.py, or prompt template is touched, so no manual dispatch verification is required, and the "Safety model impact" checklist does not apply.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson