Closed peanutfun closed 1 year ago
I really like this suggestion. I think I'd vote for **kwargs
over *args
though since ithe additional arguments are associated with keywords as opposed to simply being additional positional arguments.
As for how to do this, I think we should try to detect both cmake_parse_args
and :keyword xxxx:
. If either is found we then add *args
/**kwargs
to the signature. If we look for both we then are able to handle scenarios where:
cmake_parse_args
isn't called directly (e.g., it's called in a wrapper)CMinx already has most of the code to support this so hopefully it shouldn't be too difficult. I'll get working on that
Is your feature request related to a problem? Please describe. CMinx documents the parameter list of a CMake function. However, by CMake's nature, additional unnamed arguments can always be passed to a function. Usually, these are then parsed by
cmake_parse_arguments
. However, it's confusing to read the documentation of a function with named arguments that accepts additional parameters. Take this example (excerpt from the docs):Describe the solution you'd like I realize this is a stretch but it would be really great if CMinx could detect the call to
cmake_parse_arguments
in the function body and then automatically add an indicator that the function may take additional arguments. I would like the result to look something likeNotice the
*args
(or something similar) as new indicator.Describe alternatives you've considered Alternatively, the
*args
could simply be added if a keyword/parameter specified in the comment block does not appear in the function signature.Additional context None