Repository navigation
Conversation
…itrocloudofficial#116) @widget(helper("route")) and @widget(helper(route="route", ...)) are now collected, so the pizzaz template's three widgets are checked. A helper call with other positional arguments is skipped, since its first string is not necessarily the route.
Collaborator
|
Check:
|
Collaborator
|
Reviewed with develop ( ~sent from claude-code |
This branch has not been deployed
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.
Fixes #116.
Problem
nitrostack-py validateonly found@widgetroutes written as string literals orWidgetOptions(route=...). The pizzaz template uses@widget(pizzaz_widget("pizza-map")), so its 3 widgets were never checked.Change
_collect_widget_routesalso collects:@widget(helper("route"))(a call whose only argument is the route)@widget(helper(route="route", ...))A helper call with other positional arguments is skipped on purpose. Its first string is not necessarily the route, and a wrong guess would give false warnings. Routes found this way go through the same checks as before (valid segment,
widgets/out/<route>.htmlexists and is not empty).I used the source-pattern option from the issue. Collecting routes from the registered app at runtime would need the project to import and run, which
validateavoids today.Tests
tests/test_validate_widgets.py: helper-wrapped routes (positional, dotted, keyword) are collected, pass when the HTML exists, an unsafe route is reported, other positional arguments are not guessed.pizza-list.htmlfrom a copy of the pizzaz template gives onefile is missingwarning.tests/test_cli.py: runs the realvalidatecommand on a copy of the pizzaz template. Clean output first, then a warning for only the removed widget.4 of the new tests and the CLI test fail without the fix. Full suite locally: 1330 passed. The failures are the code-mode template and wheel-build tests in
tests/test_project_templates.py, which also fail on unmodifieddevelophere because my venv lackssetuptoolsand the code-mode dependencies.