Skip to content

SizeBudgetFile

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Reads a size-budget document: { "budgets": [ ... ] } where each entry is either a spec string in the SizeBudgetParser grammar or an object { "name", "description", "scope", "max", "growth", "severity", "topN" } — the object form is how a team names its budgets, downgrades one to a warning, or pins a per-budget contributor count. Both forms mix freely in one document. The CLI’s --budget-file and the MCP server’s inline budget JSON share this one parser.

public static class SizeBudgetFile

ObjectSizeBudgetFile

Loads a budget document from a file.

Parameters:

  • path (String): The path of the JSON document.

Returns: IReadOnlyList<SizeBudget>

The parsed budgets, in document order.

Exceptions:

public static IReadOnlyList<SizeBudget> Load(string path)

Parses a budget document from its JSON text.

Parameters:

  • json (String): The document text.

Returns: IReadOnlyList<SizeBudget>

The parsed budgets, in document order.

Exceptions:

  • FormatException: The document is not valid JSON or an entry is malformed.
public static IReadOnlyList<SizeBudget> Parse(string json)