Skip to content

chore: force-overwrite util - #1107

Merged
joshua-benchling merged 6 commits into
mainfrom
jherna/safe-overwrite-utils
Oct 28, 2025
Merged

chore: force-overwrite util#1107
joshua-benchling merged 6 commits into
mainfrom
jherna/safe-overwrite-utils

Conversation

@joshua-benchling

Copy link
Copy Markdown
Collaborator

Enhanced the existing --overwrite flag with deletion detection and added a new --force-overwrite flag to handle intentional field removals safely.

Now detects deletions and blocks with error

DELETION DETECTED: Cannot overwrite test data for 'tests/.../file.json'
Total fields to be deleted: 3

Fields that will be deleted:
  - root['...']['field_name']
  ...

To proceed anyway, use the --force-overwrite flag.

Manual testing:

Screen.Recording.2025-10-23.at.7.59.17.PM.mov

@nathan-stender nathan-stender left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great work - code LGTM!

One small change to the message printed for copying - removing printing the deleted lines twice and adding a couple newlines helps with readability

Comment thread src/allotropy/testing/utils.py Outdated
Comment thread src/allotropy/testing/utils.py Outdated
@nathan-stender nathan-stender changed the title feat: force-overwrite util chore: force-overwrite util Oct 24, 2025
@joshua-benchling
joshua-benchling merged commit 10a0683 into main Oct 28, 2025
7 checks passed
@joshua-benchling
joshua-benchling deleted the jherna/safe-overwrite-utils branch October 28, 2025 23:08
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