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

fix(cli): prevent overwriting paths when using --staged or --changed options #3074

Merged
merged 4 commits into from
Jun 6, 2024

Conversation

unvalley
Copy link
Member

@unvalley unvalley commented Jun 5, 2024

Summary

Closes #3069

Context:

The PR #2726 overwrite the biome (lint|format|check|ci) command's target path when the path is empty.
But, when using --staged and --changed options, the path would be intentionally empty. When there is no file in staging (--staged) or there is no difference from a certain branch (--changed), the file to be executed need not exist.

So, in this PR, make sure that paths are not overwritten when either --staged or --changed is used.

Test Plan

Added snapshot cases.
And manually tested --staged and --changed commands.

@github-actions github-actions bot added the A-CLI Area: CLI label Jun 5, 2024
@unvalley unvalley marked this pull request as draft June 5, 2024 17:08
@unvalley unvalley marked this pull request as ready for review June 5, 2024 18:05
@unvalley unvalley requested review from a team June 5, 2024 18:12
@github-actions github-actions bot added the A-Changelog Area: changelog label Jun 6, 2024
@unvalley unvalley merged commit 78bfeef into biomejs:main Jun 6, 2024
10 checks passed
@unvalley unvalley deleted the fix-vcs-related-options-regression branch June 6, 2024 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 --staged regression in v1.8.0
2 participants