Repository navigation
feat(pantry): don't count missing optional ingredients - #594
Merged
Merged
Conversation
Following spec proposal 0018, `pantry recipes` treats a recipe whose only absent ingredients are optional (`@?chives`) as a full match, and works out partial-match percentages over required ingredients only. `pantry plan` never plans optional ingredients. An ingredient used both ways is required. `doctor`'s aisle check still sees every ingredient.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of the CookCLI side of spec proposal 0018 — independent of #592/#593.
cook pantry recipes: wanted ingredients are the recipe's required ones, so a missing@?chivesno longer demotes a recipe to a partial match, and partial percentages / missing lists are over required ingredients.cook pantry plan: optional ingredients are never planned.@parmesan{100%g}…@?parmesan{50%g}) is required.cook doctor aislestill checks every ingredient, optional included — they still need an aisle.Core: new
find::required_ingredients, used bypantry::recipesandpantry::plan. Tests for full/partial matches, mixed use, and the plan.docs/pantry.mdnotes the behaviour.cargo test --all-features --workspacepasses.