Skip to content

Commit

Permalink
adds new no_diff field to config schema
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraschauer authored and copernico committed Jul 30, 2024
1 parent 7c076db commit f8c85d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions prospector/core/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions prospector/util/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class DatabaseConfig:
class ReportConfig:
format: str
name: str
no_diff: bool


# Schema class for "llm_service" configuration
Expand Down

0 comments on commit f8c85d2

Please sign in to comment.