Skip to content

Commit 82f2994

Browse files
committed
store sarif tool data
1 parent a91d084 commit 82f2994

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/codemodder/result.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,18 @@ def fuzzy_column_match(pos: CodeRange, location: Location) -> bool:
177177

178178

179179
class ResultSet(dict[str, dict[Path, list[Result]]]):
180-
results_for_rule: dict[str, list[Result]]
181-
182-
def __init__(self, *args, **kwargs):
183-
super().__init__(*args, **kwargs)
184-
self.results_for_rule = {}
180+
results_for_rule: dict[str, list[Result]] = {}
181+
# stores SARIF runs.tool data
182+
tools: list[dict[str, dict]] = []
185183

186184
def add_result(self, result: Result):
187185
self.results_for_rule.setdefault(result.rule_id, []).append(result)
188186
for loc in result.locations:
189187
self.setdefault(result.rule_id, {}).setdefault(loc.file, []).append(result)
190188

189+
def store_tool_data(self, tool_data: dict):
190+
self.tools.append(tool_data)
191+
191192
def results_for_rule_and_file(
192193
self, context: CodemodExecutionContext, rule_id: str, file: Path
193194
) -> list[Result]:

0 commit comments

Comments
 (0)