-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on unused arguments #238
Conversation
Adds a new flag, warn_unused, to Template.evaluate; defaults to True. This raises a warning if not all of the mandatory parameters are provided to the Template when it is evaluated. Will raise warning if optional arguments are required (when using the corresponding flag on Template.evaluate)
There's a subtle logic bug in here that is causing the tests to fail; I'm anticipating a relatively minor change to the code, but feel free to hold off on review for a day |
Co-authored-by: Tobias Shapinsky <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any issues with this PR. Do we think the tests will be fixed by the other PR being merged?
They won't be, I don't think. There's a subtle issue with dependencies more than 1 'hop' away that I'm still trying to fix |
Due to how we have the dependencies structured, the mapsTo relationship needs to refer to a connection point that lies in a dependency's dependency. This makes that relationship explicit
New problem is when we are testing the libraries for validity, sometimes we want to give an explicit argument to the 'mapsto' optional arg w/n a dependency. However, we currently can't give a binding to a nested dependency. The result is that we end up with multiple mapsto (because the 'optional' mapsto argument gets a newly minted URI from template.fill()), which fails validation. This commit splits template dependency management into 2 phases: an initial phase which adds the dependency links and args to the DB; a second phase which checks that the args/params between the template and its dependencies are all valid and work as expected.
…OTIF into gtf-warn-unused-issue-203
Logic bug is fixed as discussed on the call today -- this is ready for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions about untested methods and suggestions for grammar and punctuation.
Co-authored-by: Matt Steen <[email protected]>
Co-authored-by: Matt Steen <[email protected]>
Co-authored-by: Matt Steen <[email protected]>
Co-authored-by: Matt Steen <[email protected]>
Co-authored-by: Matt Steen <[email protected]>
Co-authored-by: Matt Steen <[email protected]>
Co-authored-by: Matt Steen <[email protected]>
Fixes #203 and #237
Cleans up template evaluation with some more utility functions (all tested), and some additional comments. Also adds a few tests to cover untested edge cases in template evaluation. Fixes behavior around inlining dependencies with optional arguments (#237)