recipe_grid.lint: Recipe linting

A collection of (fairly basic) linting functions for sanity checking recipes.

The following function will lint a (series of) Recipe descriptions.

recipe_grid.lint.check(recipe_blocks: Iterable[Recipe]) Iterable[Lint]

Run all linting checks against a given recipe.

Linting errors are described by Lint objects:

class recipe_grid.lint.Lint(kind: LintKind, description: str)

A description a piece of lint found in a recipe.

kind: LintKind
description: str

Different categories of linting errors are identified by members of the following enumeration. Further details, however, are only given as human-readable strings.

class recipe_grid.lint.LintKind(value)

Kinds of lint.

unused_ingredient = 1
sub_recipe_quantity_unknown = 2
sub_recipe_reference_incompatible_units = 3
sub_recipe_reference_non_positive_remainder = 4
sub_recipe_not_used_up = 5
sub_recipe_used_too_much = 6