Test the scorer's code-health weight and each failure it names
This commit is contained in:
@@ -46,7 +46,7 @@ def ranked(items: list[EpicItem], formula: str, epic_goals: str, repos: dict[str
|
||||
if each.repo not in scorings:
|
||||
if each.repo is not None and each.repo not in repos:
|
||||
return Failure(f"{name} is in the repo {each.repo}, whose goals were not read")
|
||||
scoring = chain_scoring(parsed, epic_goals, each.repo, repos.get(each.repo or ""))
|
||||
scoring = chain_scoring(parsed, epic_goals, each.repo, repos[each.repo] if each.repo else None)
|
||||
if isinstance(scoring, Failure):
|
||||
return scoring
|
||||
scorings[each.repo] = scoring
|
||||
@@ -69,6 +69,7 @@ def chain_scoring(formula: ast.Expression, epic_goals: str, repo: str | None, pr
|
||||
overall = latest_overall(premises.history) if premises and CODE_HEALTH in dict(goals) else None
|
||||
if isinstance(overall, Failure):
|
||||
return Failure(f"{repo}: {overall.reason}")
|
||||
# goal_weights fails only on a goal without a mark, which the check above already named by whose it is.
|
||||
weights = goal_weights(goals, overall, premises.floor if premises else decimal.Decimal(0))
|
||||
return weights if isinstance(weights, Failure) else ranking.Scoring(SHAPE, formula, 0, 0, dict(goals), weights)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user