Skip to content

Commit

Permalink
Make error more accurate.
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew committed Oct 26, 2024
1 parent e09a761 commit 22fa6da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 4 additions & 7 deletions crates/biome_cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::changed::{get_changed_files, get_staged_files};
use crate::cli_options::{cli_options, CliOptions, CliReporter, ColorsArg};
use crate::diagnostics::{
DeprecatedArgument, DeprecatedConfigurationFile, IncompatibleEndConfiguration,
};
use crate::diagnostics::{DeprecatedArgument, DeprecatedConfigurationFile};
use crate::execute::Stdin;
use crate::logging::LoggingKind;
use crate::{
Expand Down Expand Up @@ -805,10 +803,9 @@ fn check_fix_incompatible_arguments(options: FixFileModeOptions) -> Result<(), C
} else if suppress && fix {
return Err(CliDiagnostic::incompatible_arguments("--suppress", "--fix"));
} else if !suppress && suppression_reason.is_some() {
return Err(CliDiagnostic::IncompatibleEndConfiguration(
IncompatibleEndConfiguration {
reason: "`--reason` is only valid when `--suppress` is used.".to_string(),
},
return Err(CliDiagnostic::unexpected_argument(
"--reason",
"`--reason` is only valid when `--suppress` is used.",
));
};
Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ expression: content
# Termination Message

```block
internalError/io ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
flags/invalid ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× The combination of configuration and arguments is invalid:
`--reason` is only valid when `--suppress` is used.
× Unrecognized option --reason.
i Type the following command for more information
$ biome `--reason` is only valid when `--suppress` is used. --help
Expand Down

0 comments on commit 22fa6da

Please sign in to comment.