Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add checks for overwrite protection before running expensive operations #164

Conversation

SoloSynth1
Copy link
Collaborator

@SoloSynth1 SoloSynth1 commented Jun 18, 2024

This PR adds a file overwrite check in expensive operation i.e. evaluate before the expensive calls (e.g. calls to APIs) happens.

Now, if the command runs when supplied with a -e/--export-report-to argument AND without a -o/--overwrite argument, it will check if a file has existed in the path. If yes, it will raise error and exit WITHOUT running the API calls.

This PR also adds a relevant test on the check, and re-organized all test fixtures into a root-level conftest.py.

Closes #163.

@JohnShiuMK
Copy link
Collaborator

Screenshot 2024-06-20 at 11 49 12 AM @SoloSynth1 not sure if we can avoid these warnings, other than that, looks good to me

Copy link
Collaborator

@JohnShiuMK JohnShiuMK left a comment

Choose a reason for hiding this comment

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

looks good to me, thanks!

@JohnShiuMK JohnShiuMK merged commit bfec0a7 into main Jun 20, 2024
2 checks passed
@JohnShiuMK JohnShiuMK deleted the 163-add-checks-for-overwrite-protection-before-running-expensive-operations branch June 20, 2024 18:50
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.

Add checks for overwrite protection before running expensive operations
2 participants