Skip to content

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

Merged
dyc3 merged 1 commit intomainfrom
incompat-args-reasons
Jul 7, 2025
Merged

fix(cli): improve error messages when given incompatible arguments#6753
dyc3 merged 1 commit intomainfrom
incompat-args-reasons

Conversation

@dyc3
Copy link
Copy Markdown
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.

@changeset-bot
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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

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
Copy Markdown
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
Copy Markdown
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