Skip to content

Commit

Permalink
one more
Browse files Browse the repository at this point in the history
  • Loading branch information
willarmiros committed Mar 4, 2024
1 parent 6ce4a6c commit 08f666f
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions modelscan/modelscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"] = []

Expand Down

0 comments on commit 08f666f

Please sign in to comment.