Skip to content

Commit

Permalink
Use text attribute for ArtifactContent (#318)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Brown <[email protected]>
  • Loading branch information
ericwb authored Mar 4, 2024
1 parent 2020e9d commit 094eb54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions precli/renderers/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def to_fix(self, file_name: str, fix: Fix):
end_column=fix.deleted_location.end_column,
),
inserted_content=sarif_om.ArtifactContent(
fix.inserted_content
text=fix.inserted_content,
),
),
],
Expand Down Expand Up @@ -99,13 +99,13 @@ def render(self, run: Run):
end_line=result.location.end_line,
start_column=result.location.start_column,
end_column=result.location.end_column,
snippet=sarif_om.ArtifactContent(code_line),
snippet=sarif_om.ArtifactContent(text=code_line),
)

physical_location.context_region = sarif_om.Region(
start_line=result.location.start_line - 1,
end_line=result.location.end_line + 1,
snippet=sarif_om.ArtifactContent(result.snippet),
snippet=sarif_om.ArtifactContent(text=result.snippet),
)

sarif_result = sarif_om.Result(
Expand Down

0 comments on commit 094eb54

Please sign in to comment.