-
Notifications
You must be signed in to change notification settings - Fork 86
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
Dispatch params/pdoc 37 #33
Dispatch params/pdoc 37 #33
Conversation
* Test positive cases (warnings AREN'T printed when they shouldn't be) * Test puppet functions which use dispatches
return [] if param_name_ident == type_specifier | ||
param_name = param_name_ident.source | ||
#require 'pry'; binding.pry | ||
#puts [param_name, param_signature].inspect |
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.
Commented out debug lines ;)
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 should write a pre commit hook which greps for these. Thanks.
Except the debug statements I am 👍 on this. Really awesome work @iankronquist nice job. @hlindberg Could you take a second look at this? As someone who's familiar with Puppet AST nodes and the parser. |
end | ||
|
||
# If the overload_signatures list is empty because we couldn't find any | ||
# dispatch blocks, then there must be one function named the same as the |
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.
"must be one method" instead of "must be one function" (would make the comment more clear).
I would like to see an example that uses parameterized types e.g. Integer[2,10] |
64dd545
to
ee73970
Compare
|
@hlindberg Let me know when you're happy with this, I'll give it a final once over and merge |
+1 |
The previous iteration eagerly grabbed all parameters when any puppet function was created. We did not retrieve type information and would grab parameters from any helper functions! * Parse the Ruby AST for dispatch blocks which specify type information. Parse the commands and arguments in those blocks. * If there are no dispatch blocks, parse the AST for a ruby function with the same name as the puppet function being created.
7a7f4b9
to
081bbfe
Compare
@hlindberg sorry about that. I revised two of the tests (a positive and a negative case) to reflect that. The tests pass locally and on travis so I squashed and believe this is ready to merge. |
@hkenney