Skip to content

Commit e401186

Browse files
authored
feat(error-msg): add path to parsing error message (#296)
The error message on it's own is a bit bare. I can barely do anything with the following ``` 2026-01-07 13:08:31.885294487 +00:00:00 [ERROR] failed to parse license 'GPL-3.0' into a valid expression: GPL-3.0 ^^^^^^^ a deprecated license identifier was used ``` Especially since it doesn't come from my source tree but from a dependency. This commit adds the path of the file that's the reason for this error. The file path should at least include the name of the dependency so one could go there and ask for fixing the license identifier.
1 parent 78444ca commit e401186

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/licenses/scan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub(crate) fn check_is_license_file(
9797
Ok(expr) => expr,
9898
Err(err) => {
9999
log::error!(
100-
"failed to parse license '{}' into a valid expression: {err}",
100+
"failed to parse license '{}' at {path:?} into a valid expression: {err}",
101101
ided.id.name
102102
);
103103
return None;
@@ -116,7 +116,7 @@ pub(crate) fn check_is_license_file(
116116
Ok(expr) => expr,
117117
Err(err) => {
118118
log::error!(
119-
"failed to parse license '{}' into a valid expression: {err}",
119+
"failed to parse license '{}' at {path:?} into a valid expression: {err}",
120120
ided.id.name
121121
);
122122
return None;

0 commit comments

Comments
 (0)