Skip to content

Commit

Permalink
docs: add instructions to fix sarif paths in clippy-sarif
Browse files Browse the repository at this point in the history
  • Loading branch information
psastras committed Jan 10, 2024
1 parent bf3cf76 commit 36ef474
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clippy-sarif/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,16 @@ jobs:
sarif_file: results.sarif
```
In some cases, the path to the file contained in the SARIF report [may be different than what is expected](https://github.com/psastras/sarif-rs/issues/370). This can happen for example if running `clippy-sarif` from a different folder than the crate folder. In this case consider using a tool like `jq` to amend to path:

## Example

```bash
cat results.sarif \
| jq --arg pwd "some_folder/my_crate" '.runs[].results[].locations[].physicalLocation.artifactLocation.uri |= $pwd + "/" + .' \
> results.sarif.tmp
```

Note that this maybe be fixed in a future release.

License: MIT

0 comments on commit 36ef474

Please sign in to comment.