From 1bc47709423ed027b4c953288c355f8448bf004f Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 7 Jan 2026 14:15:23 +0100 Subject: [PATCH] feat(error-msg): add path to parsing error message 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. --- src/licenses/scan.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/licenses/scan.rs b/src/licenses/scan.rs index 35bd264..3cdbb49 100644 --- a/src/licenses/scan.rs +++ b/src/licenses/scan.rs @@ -97,7 +97,7 @@ pub(crate) fn check_is_license_file( Ok(expr) => expr, Err(err) => { log::error!( - "failed to parse license '{}' into a valid expression: {err}", + "failed to parse license '{}' at {path:?} into a valid expression: {err}", ided.id.name ); return None; @@ -116,7 +116,7 @@ pub(crate) fn check_is_license_file( Ok(expr) => expr, Err(err) => { log::error!( - "failed to parse license '{}' into a valid expression: {err}", + "failed to parse license '{}' at {path:?} into a valid expression: {err}", ided.id.name ); return None;