Skip to main content

Module doctor

Module doctor 

Source
Expand description

The checks behind cook doctor.

validate walks every .cook and .menu file under a root, parses it, and reports what it found. Broken recipes are the payload, not a failure: a collection full of syntax errors still validates successfully. See Outcome for the rule. broken_references follows up on what it found, resolving the recipe references a report collected.

Validation uses the shared PARSER. A timer whose quantity is text, such as ~{a few%minutes}, is reported here as a warning and left alone by every other command.

aisle_coverage and pantry_coverage answer the other two questions cook doctor asks: which of a collection’s ingredients are categorised in aisle.conf, and which of them are already in the pantry.

Structs§

CheckedIngredient
One ingredient a collection uses, and whether a configuration knows it.
CoverageRequest
Which collection to check a configuration against.
IngredientCoverage
How much of a collection’s ingredients a configuration accounts for.
RecipeValidation
What validating one recipe found.
ValidateRequest
A validation run.
ValidationReport
Everything validate found under one root.

Functions§

aisle_coverage
Check the collection’s ingredients against the aisle configuration Context::aisle names — the question cook doctor aisle asks.
broken_references
Resolve every reference a report collected, keeping the ones that lead nowhere.
pantry_coverage
Check the collection’s ingredients against the pantry configuration Context::pantry names — the question cook doctor pantry asks.
validate
Validate every recipe under req’s root.