From a09f95c01962047161a7165d2448ec6b06667445 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Thu, 28 Nov 2024 17:31:08 +0000 Subject: [PATCH] feat: make file locations more navigable Closes kemitix/forgejo-todo-checker#24 --- src/model/line.rs | 2 +- src/tests/scanner.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/model/line.rs b/src/model/line.rs index fbf31e3..09f3f91 100644 --- a/src/model/line.rs +++ b/src/model/line.rs @@ -40,7 +40,7 @@ impl std::fmt::Display for Line { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { writeln!( f, - "{}#{}:\n {}", + "{}:{}:\n {}", self.relative_path.to_string_lossy(), self.num, self.value.trim() diff --git a/src/tests/scanner.rs b/src/tests/scanner.rs index 201a984..6ed434e 100644 --- a/src/tests/scanner.rs +++ b/src/tests/scanner.rs @@ -44,9 +44,9 @@ fn find_markers_in_dir() { assert_eq!( printer.messages.take(), vec![ - "- Issue number missing: file_with_invalids.txt#3:\n It contains a todo comment: // TODO: this is it\n", - "- Issue number missing: file_with_invalids.txt#5:\n It also contains a fix-me comment: // FIXME: and this is it\n", - "- Closed/Invalid Issue: (3) file_with_invalids.txt#9:\n We also have a todo comment: // TODO: (#3) and it has an issue number, but it is closed\n", + "- Issue number missing: file_with_invalids.txt:3:\n It contains a todo comment: // TODO: this is it\n", + "- Issue number missing: file_with_invalids.txt:5:\n It also contains a fix-me comment: // FIXME: and this is it\n", + "- Closed/Invalid Issue: (3) file_with_invalids.txt:9:\n We also have a todo comment: // TODO: (#3) and it has an issue number, but it is closed\n", format!(">> 3 errors in {}\n", file_with_invalids.strip_prefix(fs.base()).expect("strip prefix").to_string_lossy()).as_str() ] );