From 08f666fdcdaac8a1d7af755d5145913ddf94b9b3 Mon Sep 17 00:00:00 2001 From: William Armiros Date: Mon, 4 Mar 2024 15:24:14 -0800 Subject: [PATCH] one more --- modelscan/modelscan.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/modelscan/modelscan.py b/modelscan/modelscan.py index 8f91b4a..7627fac 100644 --- a/modelscan/modelscan.py +++ b/modelscan/modelscan.py @@ -221,15 +221,10 @@ def _generate_results(self) -> Dict[str, Any]: if self._scanned: scanned_files = [] - try: - for file_name in self._scanned: - resolved_file = Path(file_name).resolve() - scanned_files.append( - str(resolved_file.relative_to(Path(absolute_path))) - ) - except Exception: - logger.warning( - f"Could not record scanned file {file_name}", exc_info=True + for file_name in self._scanned: + resolved_file = Path(file_name).resolve() + scanned_files.append( + str(resolved_file.relative_to(Path(absolute_path))) ) report["summary"]["scanned"]["scanned_files"] = scanned_files @@ -240,9 +235,8 @@ def _generate_results(self) -> Dict[str, Any]: ] for issue in report["issues"]: - issue["source"] = str( - Path(issue["source"]).relative_to(Path(absolute_path)) - ) + resolved_file = Path(issue["source"]).resolve() + issue["source"] = str(resolved_file.relative_to(Path(absolute_path))) else: report["issues"] = []