Skip to content

Commit

Permalink
make source path relative for FlawFinder
Browse files Browse the repository at this point in the history
  • Loading branch information
kenohassler committed Mar 7, 2024
1 parent 47cded5 commit 57e69df
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ def _sanity_checks(self, string: str) -> None:
default_sarif_checks(string)

def _format(self, string: str) -> SASTFlags:
return convert_sarif(string)
flags = SASTFlags()

# convert absolute paths to relative ones
for flag in convert_sarif(string):
file = str(Path(flag.file).relative_to(self._subject_dir))
flags.add(SASTFlag(flag.tool, file, flag.line, flag.vuln))

return flags


class SemgrepRunner(SASTToolRunner):
Expand Down

0 comments on commit 57e69df

Please sign in to comment.