Skip to content

Add control over overwrites for non-interactive use - #47

Merged
thompsonmj merged 5 commits into
mainfrom
feat/force-flag
Jul 29, 2026
Merged

Add control over overwrites for non-interactive use#47
thompsonmj merged 5 commits into
mainfrom
feat/force-flag

Conversation

@thompsonmj

Copy link
Copy Markdown
Collaborator

Addresses #11, using the approach outlined in option number three from this comment.

  • Default behavior: does not overwrite existing output file
  • Add a flag to Python API and CLI that would enable forcing the overwrite (force=True and -f / --force)
    • This will make updating cautious-robot necessary at an upstream arg or directly here.
  • Add a clear error message with instructions in case of such an event
  • README ocumentation and tests

thompsonmj and others added 5 commits July 27, 2026 13:54
Refuse to overwrite an existing output file by default in both the
library and the CLI, per the consensus on #11 (option 3):

- get_checksums gains force=False and raises OutputFileExistsError
  (subclass of FileExistsError) before any walking or hashing when the
  output file exists
- CLI replaces the interactive overwrite prompt with -f/--force and a
  clear error message, making all runs non-interactive

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@thompsonmj
thompsonmj requested a review from egrace479 July 27, 2026 21:24

@egrace479 egrace479 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@thompsonmj

Copy link
Copy Markdown
Collaborator Author

I'll also make a note here that a portion of the changes in this PR were due to the version bump of Ruff to 0.16. Since our CI depends on ruff check passing, and we have it as an unpinned dependency, including these changes in this PR does feel consistent with the implicit imperative in the existing code quality design, which is "adhere to ruff defaults". In this case, it affected code unrelated to this PR, and we aren't alone in experiencing this [for example].

After merging this however, I'll open a few issues dedicated to addressing this for preempting future similar surprises and working with the linter in with more controlled approach, per offline discussion with @egrace479.

@thompsonmj
thompsonmj merged commit 9e3241d into main Jul 29, 2026
9 checks passed
@thompsonmj thompsonmj mentioned this pull request Jul 29, 2026
@thompsonmj
thompsonmj deleted the feat/force-flag branch July 29, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants