Repository navigation
fix(cli): refuse pin --days 0 and --days without a folder - #9
Merged
Merged
Conversation
`opensweep pin FOLDER --days 0` printed "Pinned ... for 0 days" and wrote a pin that had already ended, so the project was judged as usual. `opensweep pin --days 7` with no folder listed the pins and dropped --days without a word. Both are now usage errors and nothing is written. The app only pins for 30 days or for good, so it is not affected. Also gives the FOLDER argument of pin and unpin a help line; `--help` showed it blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Two ways
pinaccepted--daysand did not do what it said:opensweep pin FOLDER --days 0printed "Pinned ... for 0 days." and wrote a pin whose end time was already now. The project was judged as usual straight away, but the user had just been told it was pinned.pinthen still listed it with "(until )".opensweep pin --days 7with no folder only listed the pins and dropped--dayswithout a word.Both are now clap usage errors (exit code 2) and the config file is not written.
--daystakes 1 or more and needs a folder.--dayswith--remotewas already refused.The app only calls
pin --days 30orpinwith no days (ProjectsView.swift), so it is not affected.Also gives the
FOLDERargument ofpinandunpina help line;opensweep pin --helpshowed it blank.How tested
a_pin_for_days_needs_a_folder_and_at_least_one_day:--days 0and--dayswithout a folder fail and write no config;--days 1still works. It fails onmainand passes with the fix.cargo fmt --all --check: okcargo clippy --all-targets --locked -- -D warnings: okcargo test --locked: 146 passed, 0 failedcargo run -q -p opensweep-cli -- rules-check rules: 11 rule files, 31 artifacts: okcd CleanCore && swift test: 21 tests, 0 failures;scripts/check-swift-never-deletes.sh: ok🤖 Generated with Claude Code