Skip to content

fix(cli): improve error messages when given incompatible arguments #6753

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

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented Jul 7, 2025

Summary

The error messages we provided previously in these cases resulted in some confusing error messages, particularly when --since was provided without --changed. This fixes that.

partially addresses #4225. I didn't link the issue in the changeset because the issue is primarily something different.

Test Plan

Updated snapshots.

Copy link

changeset-bot bot commented Jul 7, 2025

🦋 Changeset detected

Latest commit: 7fcc483

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dyc3 dyc3 requested review from a team July 7, 2025 14:50
@github-actions github-actions bot added the A-CLI Area: CLI label Jul 7, 2025
Copy link
Contributor

@arendjr arendjr left a comment

Choose a reason for hiding this comment

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

❤️

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Just left a thought

} else if suppress && write {
return Err(CliDiagnostic::incompatible_arguments(
"--suppress",
"--write",
"--write is used to write fixes, and --suppress is used to suppress diagnostics. Remove one of these arguments depending on what you want to do.",
Copy link
Member

Choose a reason for hiding this comment

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

I'm not even sure this should be considered an incompatibility anymore. Technically, --write is to write things on disk and by default if fixes rules/actions using their code fix action. However, if we use --suppress we tell Biome to change the default , and use the the suppression action.

What do you think?

We can change it later, it's just that seeing this message, made me think.

Not a blocker

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, but I think it requires a little more scrutiny.

@dyc3 dyc3 merged commit fce5d2c into main Jul 7, 2025
11 checks passed
@dyc3 dyc3 deleted the incompat-args-reasons branch July 7, 2025 17:25
@github-actions github-actions bot mentioned this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy