feat: make file locations more navigable
All checks were successful
Test / checks (map[name:nightly]) (push) Successful in 1m55s
Test / checks (map[name:stable]) (push) Successful in 2m26s

Closes kemitix/forgejo-todo-checker#24
This commit is contained in:
Paul Campbell 2024-11-28 17:31:08 +00:00
parent 4861299549
commit a09f95c019
2 changed files with 4 additions and 4 deletions

View file

@ -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()

View file

@ -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()
]
);