fix(cli): warn when a --stock entry matches no @use (audit C4) #69
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!69
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/audit-c4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Audit C4, present since 1.3.0.
--stock ./bases/x.gramis resolved from the directory the command is typed in (deliberate: a path tab-completed in a shell), so run from another directory it matches no@use— and onlygram buildandgram shopsaid so.view,cook,check,scale,exportandprintaccepted the flag and silently ignored it, as they did for a file that does not exist.Reproduced on a small project: from the project directory the base collapses into one line, from a sibling directory the full breakdown comes back with no word.
reportUnusedStock;usedStockis threaded fromrunPipelinethe way build/shop already do (checker result, view model, and anonUsedStockcallback in the export/print options so no return type changes)(a relative path is resolved from the current directory, not from the recipe)Not done on purpose:
gram watchchecks one file at a time, so an entry used by another file of the watched folder would look unused: a warning there would be wrong.Tests: 10 end-to-end cases through the real CLI (4 commands from another directory, silence from the right one, a file that does not exist, stderr only); 5 fail on the previous code.
cookandprintare implemented but not run by the tests (terminal UI / opens a browser). New patch changeset. ci (1335 tests) and conformance 98/98 pass.