From 062b10073bff6be496214fb26e50b42fe902eb6e Mon Sep 17 00:00:00 2001 From: Daniel Frederico Lins Leite Date: Thu, 17 Nov 2022 18:21:40 +0000 Subject: [PATCH] feat(rome_cli): cli exit as error when no files are found (#3722) * cli exit as error when no files are found --- crates/rome_cli/src/termination.rs | 3 ++ crates/rome_cli/src/traversal.rs | 26 +++++++----- crates/rome_cli/tests/commands/check.rs | 42 ++++++++++++++----- crates/rome_cli/tests/commands/ci.rs | 6 +-- crates/rome_cli/tests/commands/format.rs | 34 ++++++++++++--- crates/rome_cli/tests/main.rs | 9 ++-- .../main_commands_check/file_too_large.snap | 6 +++ .../file_too_large_cli_limit.snap | 6 +++ .../file_too_large_config_limit.snap | 6 +++ .../fs_error_dereferenced_symlink_unix.snap | 7 +++- ...rror_infinite_symlink_exapansion_unix.snap | 7 +++- .../main_commands_check/fs_error_symlink.snap | 23 ++++++++++ .../main_commands_check/fs_error_unknown.snap | 6 +++ ..._if_files_are_listed_in_ignore_option.snap | 6 +++ .../no_lint_if_linter_is_disabled.snap | 6 +++ ..._if_linter_is_disabled_when_run_apply.snap | 6 +++ .../no_lint_when_file_is_ignored.snap | 6 +++ .../no_supported_file_found.snap | 13 ++++++ .../main_commands_ci/file_too_large.snap | 6 +++ .../file_too_large_cli_limit.snap | 6 +++ .../file_too_large_config_limit.snap | 6 +++ ..._if_files_are_listed_in_ignore_option.snap | 6 +++ .../does_not_format_ignored_files.snap | 6 +++ .../main_commands_format/file_too_large.snap | 6 +++ .../file_too_large_cli_limit.snap | 6 +++ .../file_too_large_config_limit.snap | 6 +++ .../format_is_disabled.snap | 6 +++ .../no_supported_file_found.snap | 13 ++++++ .../main_configuration/correct_root.snap | 6 +++ 29 files changed, 256 insertions(+), 35 deletions(-) create mode 100644 crates/rome_cli/tests/snapshots/main_commands_check/fs_error_symlink.snap create mode 100644 crates/rome_cli/tests/snapshots/main_commands_check/no_supported_file_found.snap create mode 100644 crates/rome_cli/tests/snapshots/main_commands_format/no_supported_file_found.snap diff --git a/crates/rome_cli/src/termination.rs b/crates/rome_cli/src/termination.rs index 17f00859d15..8a1a6ee772a 100644 --- a/crates/rome_cli/src/termination.rs +++ b/crates/rome_cli/src/termination.rs @@ -76,6 +76,9 @@ pub enum Termination { #[error("The combination of configuration and arguments is invalid: \n {0}")] IncompatibleEndConfiguration(&'static str), + + #[error("no files were processed in the specified paths.")] + NoFilesWereProcessed, } fn command_name() -> String { diff --git a/crates/rome_cli/src/traversal.rs b/crates/rome_cli/src/traversal.rs index 55414bff667..fd6fcb5ef90 100644 --- a/crates/rome_cli/src/traversal.rs +++ b/crates/rome_cli/src/traversal.rs @@ -206,7 +206,9 @@ pub(crate) fn traverse(execution: Execution, mut session: CliSession) -> Result< } // Processing emitted error diagnostics, exit with a non-zero code - if errors > 0 { + if (count - skipped) == 0 { + Err(Termination::NoFilesWereProcessed) + } else if errors > 0 { Err(Termination::CheckError) } else { Ok(()) @@ -605,6 +607,10 @@ struct TraversalOptions<'ctx, 'app> { } impl<'ctx, 'app> TraversalOptions<'ctx, 'app> { + fn increment_processed(&self) { + self.processed.fetch_add(1, Ordering::Relaxed); + } + /// Send a message to the display thread fn push_message(&self, msg: impl Into) { self.messages.send(msg.into()).ok(); @@ -688,11 +694,8 @@ impl<'ctx, 'app> TraversalContext for TraversalOptions<'ctx, 'app> { /// traversal function returns Err or panics) fn handle_file(ctx: &TraversalOptions, path: &Path, file_id: FileId) { match catch_unwind(move || process_file(ctx, path, file_id)) { - Ok(Ok(FileStatus::Success)) => { - ctx.processed.fetch_add(1, Ordering::Relaxed); - } + Ok(Ok(FileStatus::Success)) => {} Ok(Ok(FileStatus::Message(msg))) => { - ctx.processed.fetch_add(1, Ordering::Relaxed); ctx.push_message(msg); } Ok(Ok(FileStatus::Ignored)) => {} @@ -739,13 +742,16 @@ type FileResult = Result; fn process_file(ctx: &TraversalOptions, path: &Path, file_id: FileId) -> FileResult { tracing::trace_span!("process_file", path = ?path).in_scope(move || { let rome_path = RomePath::new(path, file_id); + let supported_format = ctx .can_format(&rome_path) .with_file_id_and_code(file_id, category!("files/missingHandler"))?; + let supported_lint = ctx .can_lint(&rome_path) .with_file_id_and_code(file_id, category!("files/missingHandler"))?; - let supported_file = match ctx.execution.traversal_mode() { + + let unsupported_reason = match ctx.execution.traversal_mode() { TraversalMode::Check { .. } => supported_lint.reason.as_ref(), TraversalMode::CI { .. } => supported_lint .reason @@ -754,7 +760,7 @@ fn process_file(ctx: &TraversalOptions, path: &Path, file_id: FileId) -> FileRes TraversalMode::Format { .. } => supported_format.reason.as_ref(), }; - if let Some(reason) = supported_file { + if let Some(reason) = unsupported_reason { return match reason { UnsupportedReason::FileNotSupported => { Err(Message::from(UnhandledDiagnostic.with_file_path(file_id))) @@ -773,6 +779,7 @@ fn process_file(ctx: &TraversalOptions, path: &Path, file_id: FileId) -> FileRes let mut input = String::new(); file.read_to_string(&mut input).with_file_id(file_id)?; + ctx.increment_processed(); let file_guard = FileGuard::open( ctx.workspace, @@ -797,12 +804,9 @@ fn process_file(ctx: &TraversalOptions, path: &Path, file_id: FileId) -> FileRes if fixed.code != input { file.set_content(fixed.code.as_bytes()) .with_file_id(file_id)?; - - return Ok(FileStatus::Success); } - // If the file isn't changed, do not increment the "fixed files" counter - return Ok(FileStatus::Ignored); + return Ok(FileStatus::Success); } let categories = if ctx.execution.is_format() || supported_lint.reason.is_some() { diff --git a/crates/rome_cli/tests/commands/check.rs b/crates/rome_cli/tests/commands/check.rs index 011019a793c..d5f9d47ae5c 100644 --- a/crates/rome_cli/tests/commands/check.rs +++ b/crates/rome_cli/tests/commands/check.rs @@ -350,7 +350,7 @@ fn no_lint_if_linter_is_disabled_when_run_apply() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut buffer = String::new(); fs.open(file_path) @@ -386,7 +386,7 @@ fn no_lint_if_linter_is_disabled() { Arguments::from_vec(vec![OsString::from("check"), file_path.as_os_str().into()]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut buffer = String::new(); fs.open(file_path) @@ -600,7 +600,7 @@ fn no_lint_when_file_is_ignored() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut buffer = String::new(); fs.open(file_path) @@ -644,7 +644,7 @@ fn no_lint_if_files_are_listed_in_ignore_option() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut buffer = String::new(); fs.open(file_path_test1) @@ -707,7 +707,7 @@ fn fs_error_dereferenced_symlink() { remove_dir_all(root_path).unwrap(); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -762,7 +762,7 @@ fn fs_error_infinite_symlink_exapansion() { remove_dir_all(root_path).unwrap(); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -789,7 +789,7 @@ fn fs_error_unknown() { Arguments::from_vec(vec![OsString::from("check"), OsString::from("prefix")]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -814,7 +814,7 @@ fn file_too_large() { Arguments::from_vec(vec![OsString::from("check"), file_path.as_os_str().into()]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); // Do not store the content of the file in the snapshot fs.remove(file_path); @@ -844,7 +844,7 @@ fn file_too_large_config_limit() { Arguments::from_vec(vec![OsString::from("check"), file_path.as_os_str().into()]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -874,7 +874,7 @@ fn file_too_large_cli_limit() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -970,3 +970,25 @@ fn max_diagnostics() { assert_eq!(console.out_buffer.len(), 11); } + +#[test] +fn no_supported_file_found() { + let mut fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + + let result = run_cli( + DynRef::Borrowed(&mut fs), + DynRef::Borrowed(&mut console), + Arguments::from_vec(vec![std::ffi::OsString::from("check"), ".".into()]), + ); + + eprintln!("{:?}", console.out_buffer); + + assert_cli_snapshot(SnapshotPayload::new( + module_path!(), + "no_supported_file_found", + fs, + console, + result, + )); +} diff --git a/crates/rome_cli/tests/commands/ci.rs b/crates/rome_cli/tests/commands/ci.rs index 667caf5570e..8f5764435c8 100644 --- a/crates/rome_cli/tests/commands/ci.rs +++ b/crates/rome_cli/tests/commands/ci.rs @@ -376,7 +376,7 @@ fn file_too_large() { Arguments::from_vec(vec![OsString::from("ci"), file_path.as_os_str().into()]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); // Do not store the content of the file in the snapshot fs.remove(file_path); @@ -406,7 +406,7 @@ fn file_too_large_config_limit() { Arguments::from_vec(vec![OsString::from("ci"), file_path.as_os_str().into()]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -436,7 +436,7 @@ fn file_too_large_cli_limit() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), diff --git a/crates/rome_cli/tests/commands/format.rs b/crates/rome_cli/tests/commands/format.rs index ffe8890198d..f3f17086721 100644 --- a/crates/rome_cli/tests/commands/format.rs +++ b/crates/rome_cli/tests/commands/format.rs @@ -859,7 +859,7 @@ fn format_is_disabled() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut file = fs .open(file_path) @@ -1025,7 +1025,7 @@ fn does_not_format_ignored_files() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut file = fs .open(file_path) @@ -1075,7 +1075,7 @@ fn does_not_format_if_files_are_listed_in_ignore_option() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); let mut buffer = String::new(); fs.open(file_path_test1) @@ -1178,7 +1178,7 @@ fn file_too_large() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); // Do not store the content of the file in the snapshot fs.remove(file_path); @@ -1208,7 +1208,7 @@ fn file_too_large_config_limit() { Arguments::from_vec(vec![OsString::from("format"), file_path.as_os_str().into()]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -1238,7 +1238,7 @@ fn file_too_large_cli_limit() { ]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -1328,3 +1328,25 @@ fn max_diagnostics() { assert_eq!(console.out_buffer.len(), 12); } + +#[test] +fn no_supported_file_found() { + let mut fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + + let result = run_cli( + DynRef::Borrowed(&mut fs), + DynRef::Borrowed(&mut console), + Arguments::from_vec(vec![std::ffi::OsString::from("check"), ".".into()]), + ); + + eprintln!("{:?}", console.out_buffer); + + assert_cli_snapshot(SnapshotPayload::new( + module_path!(), + "no_supported_file_found", + fs, + console, + result, + )); +} diff --git a/crates/rome_cli/tests/main.rs b/crates/rome_cli/tests/main.rs index a80c3cf5dd9..301ba44a474 100644 --- a/crates/rome_cli/tests/main.rs +++ b/crates/rome_cli/tests/main.rs @@ -290,7 +290,7 @@ mod configuration { Arguments::from_vec(vec![OsString::from("format"), OsString::from("file.js")]), ); - assert!(result.is_ok(), "run_cli returned {result:?}"); + assert!(result.is_err(), "run_cli returned {result:?}"); assert_cli_snapshot(SnapshotPayload::new( module_path!(), @@ -381,8 +381,11 @@ mod configuration { let mut fs = MemoryFileSystem::default(); let mut console = BufferConsole::default(); - let file_path = Path::new("rome.json"); - fs.insert(file_path.into(), CONFIG_INCORRECT_GLOBALS_V2.as_bytes()); + fs.insert( + Path::new("rome.json").into(), + CONFIG_INCORRECT_GLOBALS_V2.as_bytes(), + ); + fs.insert(Path::new("file.js").into(), UNFORMATTED.as_bytes()); let result = run_cli( DynRef::Borrowed(&mut fs), diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap index a236529a41b..9020915849b 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large.snap @@ -2,6 +2,12 @@ source: crates/rome_cli/tests/snap_test.rs expression: content --- +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap index 23c4f0e7d88..850d624fe8f 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_cli_limit.snap @@ -9,6 +9,12 @@ statement1(); statement2(); ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap index 3e333abe2b6..3f59f46c217 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/file_too_large_config_limit.snap @@ -19,6 +19,12 @@ statement1(); statement2(); ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_dereferenced_symlink_unix.snap b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_dereferenced_symlink_unix.snap index 937c7a16ffc..b8093ba6629 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_dereferenced_symlink_unix.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_dereferenced_symlink_unix.snap @@ -1,8 +1,13 @@ --- source: crates/rome_cli/tests/snap_test.rs -assertion_line: 223 expression: content --- +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_infinite_symlink_exapansion_unix.snap b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_infinite_symlink_exapansion_unix.snap index 7b24b7173c2..80798430f81 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_infinite_symlink_exapansion_unix.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_infinite_symlink_exapansion_unix.snap @@ -1,8 +1,13 @@ --- source: crates/rome_cli/tests/snap_test.rs -assertion_line: 223 expression: content --- +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_symlink.snap b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_symlink.snap new file mode 100644 index 00000000000..72166cf73db --- /dev/null +++ b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_symlink.snap @@ -0,0 +1,23 @@ +--- +source: crates/rome_cli/tests/snap_test.rs +expression: content +--- +# Termination Message + +```block +no files were processed in the specified paths. +``` + +# Emitted Messages + +```block +prefix/ci.js internalError/fs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + + ! Symbolic links are not supported + + i Rome does not currently support visiting the content of symbolic links since it could lead to an infinite traversal loop + + +``` + + diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_unknown.snap b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_unknown.snap index 887e43ba97d..df0f67e778b 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_unknown.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/fs_error_unknown.snap @@ -2,6 +2,12 @@ source: crates/rome_cli/tests/snap_test.rs expression: content --- +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_files_are_listed_in_ignore_option.snap b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_files_are_listed_in_ignore_option.snap index 67fed0c584f..a744ea8e6d0 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_files_are_listed_in_ignore_option.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_files_are_listed_in_ignore_option.snap @@ -32,6 +32,12 @@ if(a != -0) {} ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled.snap b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled.snap index d4b8b188dad..eb0a1cc5d16 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled.snap @@ -20,6 +20,12 @@ if(a != -0) {} ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled_when_run_apply.snap b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled_when_run_apply.snap index d4b8b188dad..eb0a1cc5d16 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled_when_run_apply.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_if_linter_is_disabled_when_run_apply.snap @@ -20,6 +20,12 @@ if(a != -0) {} ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_when_file_is_ignored.snap b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_when_file_is_ignored.snap index 9acdf273287..2cbbd69dc9b 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_when_file_is_ignored.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_check/no_lint_when_file_is_ignored.snap @@ -22,6 +22,12 @@ if(a != -0) {} ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_check/no_supported_file_found.snap b/crates/rome_cli/tests/snapshots/main_commands_check/no_supported_file_found.snap new file mode 100644 index 00000000000..aab10ac5616 --- /dev/null +++ b/crates/rome_cli/tests/snapshots/main_commands_check/no_supported_file_found.snap @@ -0,0 +1,13 @@ +--- +source: crates/rome_cli/tests/snap_test.rs +expression: content +--- +# Termination Message + +```block +no files were processed in the specified paths. +``` + +# Emitted Messages + + diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap index f0bc7c89710..c859889b0a5 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large.snap @@ -2,6 +2,12 @@ source: crates/rome_cli/tests/snap_test.rs expression: content --- +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap index 527e55e39da..8df01ecb468 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_cli_limit.snap @@ -9,6 +9,12 @@ statement1(); statement2(); ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap index c55c02455d2..df3cbc33efb 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_ci/file_too_large_config_limit.snap @@ -19,6 +19,12 @@ statement1(); statement2(); ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_if_files_are_listed_in_ignore_option.snap b/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_if_files_are_listed_in_ignore_option.snap index 343fc4a0ad4..6acf37a9126 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_if_files_are_listed_in_ignore_option.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_if_files_are_listed_in_ignore_option.snap @@ -28,6 +28,12 @@ expression: content statement( ) ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_ignored_files.snap b/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_ignored_files.snap index 6e1dd2bab52..0651a3a6658 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_ignored_files.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/does_not_format_ignored_files.snap @@ -20,6 +20,12 @@ expression: content statement( ) ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large.snap b/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large.snap index 6a652f5568c..deed02b78f0 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large.snap @@ -2,6 +2,12 @@ source: crates/rome_cli/tests/snap_test.rs expression: content --- +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_cli_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_cli_limit.snap index ec960d463a1..e276c65bf80 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_cli_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_cli_limit.snap @@ -9,6 +9,12 @@ statement1(); statement2(); ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_config_limit.snap b/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_config_limit.snap index ee2a994daa9..ed7b73e1d63 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_config_limit.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/file_too_large_config_limit.snap @@ -19,6 +19,12 @@ statement1(); statement2(); ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages ```block diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/format_is_disabled.snap b/crates/rome_cli/tests/snapshots/main_commands_format/format_is_disabled.snap index ba74ebcfc7c..4edc5c38669 100644 --- a/crates/rome_cli/tests/snapshots/main_commands_format/format_is_disabled.snap +++ b/crates/rome_cli/tests/snapshots/main_commands_format/format_is_disabled.snap @@ -23,6 +23,12 @@ return { something } ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages diff --git a/crates/rome_cli/tests/snapshots/main_commands_format/no_supported_file_found.snap b/crates/rome_cli/tests/snapshots/main_commands_format/no_supported_file_found.snap new file mode 100644 index 00000000000..aab10ac5616 --- /dev/null +++ b/crates/rome_cli/tests/snapshots/main_commands_format/no_supported_file_found.snap @@ -0,0 +1,13 @@ +--- +source: crates/rome_cli/tests/snap_test.rs +expression: content +--- +# Termination Message + +```block +no files were processed in the specified paths. +``` + +# Emitted Messages + + diff --git a/crates/rome_cli/tests/snapshots/main_configuration/correct_root.snap b/crates/rome_cli/tests/snapshots/main_configuration/correct_root.snap index 8c90f7beefa..de05d70e178 100644 --- a/crates/rome_cli/tests/snapshots/main_configuration/correct_root.snap +++ b/crates/rome_cli/tests/snapshots/main_configuration/correct_root.snap @@ -43,6 +43,12 @@ expression: content } ``` +# Termination Message + +```block +no files were processed in the specified paths. +``` + # Emitted Messages