Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_cli): rename --apply-suggested to --apply-unsafe #4078

Merged
merged 1 commit into from
Dec 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/rome_cli/src/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ pub(crate) fn check(mut session: CliSession) -> Result<(), CliDiagnostic> {
.update_settings(UpdateSettingsParams { configuration })?;

let apply = session.args.contains("--apply");
let apply_suggested = session.args.contains("--apply-suggested");
let apply_suggested = session.args.contains("--apply-unsafe");

let fix_file_mode = if apply && apply_suggested {
return Err(CliDiagnostic::incompatible_arguments(
"--apply",
"--apply-suggested",
"--apply-unsafe",
));
} else if !apply && !apply_suggested {
None
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_cli/src/commands/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const CHECK: Markup = markup! {
"<Emphasis>"OPTIONS:"</Emphasis>"
"<Dim>"--apply"</Dim>" Apply safe fixes
"<Dim>"--apply-suggested"</Dim>" Apply safe and suggested fixes
"<Dim>"--apply-unsafe"</Dim>" Apply safe and unsafe fixes
"<Dim>"--max-diagnostics"</Dim>" Cap the amount of diagnostics displayed (default: 20)
"<Dim>"--verbose"</Dim>" Print additional verbose advices on diagnostics
"
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_cli/src/traversal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ fn process_messages(options: ProcessMessagesOptions) {
if mode.is_check() && total_skipped_suggested_fixes > 0 {
console.log(markup! {
<Warn>"Skipped "{total_skipped_suggested_fixes}" suggested fixes.\n"</Warn>
<Info>"If you wish to apply the suggested fixes, use the command "<Emphasis>"rome check --apply-suggested\n"</Emphasis></Info>
<Info>"If you wish to apply the suggested (unsafe) fixes, use the command "<Emphasis>"rome check --apply-unsafe\n"</Emphasis></Info>
})
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rome_cli/tests/commands/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ fn apply_suggested_error() {
&mut console,
Arguments::from_vec(vec![
OsString::from("check"),
OsString::from("--apply-suggested"),
OsString::from("--apply-unsafe"),
OsString::from("--apply"),
file_path.as_os_str().into(),
]),
Expand Down Expand Up @@ -308,7 +308,7 @@ fn apply_suggested() {
&mut console,
Arguments::from_vec(vec![
OsString::from("check"),
OsString::from("--apply-suggested"),
OsString::from("--apply-unsafe"),
file_path.as_os_str().into(),
]),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(a != 0) {}

```block
Skipped 1 suggested fixes.
If you wish to apply the suggested fixes, use the command rome check --apply-suggested
If you wish to apply the suggested (unsafe) fixes, use the command rome check --apply-unsafe
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if(a != 0) {}

```block
Skipped 1 suggested fixes.
If you wish to apply the suggested fixes, use the command rome check --apply-suggested
If you wish to apply the suggested (unsafe) fixes, use the command rome check --apply-unsafe
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ console.log(a);
```block
flags/invalid ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Incompatible arguments --apply and --apply-suggested
× Incompatible arguments --apply and --apply-unsafe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ try {

```block
Skipped 1 suggested fixes.
If you wish to apply the suggested fixes, use the command rome check --apply-suggested
If you wish to apply the suggested (unsafe) fixes, use the command rome check --apply-unsafe
```

Expand Down