Fix formatting

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Paolo Tranquilli
2026-05-13 09:48:45 +02:00
parent d16bc36e83
commit 57ac0192c0
2 changed files with 3 additions and 6 deletions

View File

@@ -299,8 +299,7 @@ pub fn extract(
) {
let path_str = file_paths::normalize_and_transform_path(path, transformer);
let source_root = std::env::current_dir().ok();
let diagnostics_path =
file_paths::relativize_for_diagnostic(path, source_root.as_deref());
let diagnostics_path = file_paths::relativize_for_diagnostic(path, source_root.as_deref());
let span = tracing::span!(
tracing::Level::TRACE,
"extract",

View File

@@ -251,16 +251,14 @@ mod tests {
#[test]
fn relativize_under_source_root() {
let path = Path::new("/home/runner/work/repo/src/foo.rb");
let result =
relativize_for_diagnostic(path, Some(Path::new("/home/runner/work/repo")));
let result = relativize_for_diagnostic(path, Some(Path::new("/home/runner/work/repo")));
assert_eq!(result, "src/foo.rb");
}
#[test]
fn relativize_outside_source_root_produces_file_uri() {
let path = Path::new("/other/location/foo.rb");
let result =
relativize_for_diagnostic(path, Some(Path::new("/home/runner/work/repo")));
let result = relativize_for_diagnostic(path, Some(Path::new("/home/runner/work/repo")));
assert_eq!(result, "file:///other/location/foo.rb");
}