From aa77cf6444909921b13b94f0095f7dcb03a65758 Mon Sep 17 00:00:00 2001 From: I748376 Date: Tue, 30 Jul 2024 07:44:46 +0000 Subject: [PATCH] adds new no_diff field to config schema --- prospector/core/report.py | 10 ++++++++-- prospector/util/config_parser.py | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/prospector/core/report.py b/prospector/core/report.py index fb9006271..0770bb70c 100644 --- a/prospector/core/report.py +++ b/prospector/core/report.py @@ -30,11 +30,15 @@ def json_( ): fn = filename if filename.endswith(".json") else f"{filename}.json" + params["enabled_rules"] = list( + params["enabled_rules"] + ) # Fix for OmegaConf not being JSON serializable data = { "parameters": params, "advisory_record": advisory_record.__dict__, "commits": [ - r.as_dict(no_hash=True, no_rules=False, no_diff=no_diff) for r in results + r.as_dict(no_hash=True, no_rules=False, no_diff=no_diff) + for r in results ], } logger.info(f"Writing results to {fn}") @@ -81,7 +85,9 @@ def html_( return fn -def console_(results: List[Commit], advisory_record: AdvisoryRecord, verbose=False): +def console_( + results: List[Commit], advisory_record: AdvisoryRecord, verbose=False +): def format_annotations(commit: Commit) -> str: out = "" if verbose: diff --git a/prospector/util/config_parser.py b/prospector/util/config_parser.py index 593bd676a..39cd65f64 100644 --- a/prospector/util/config_parser.py +++ b/prospector/util/config_parser.py @@ -184,6 +184,7 @@ class DatabaseConfig: class ReportConfig: format: str name: str + no_diff: bool # Schema class for "llm_service" configuration