Flag optional arguments in doxygen pydoc output
If the parameter has a default value, add the string ", optional" to the parameter type description in the translated python comments. Three examples with default values were already present in the test cases, so their expected python output has been updated accordingly.
This commit is contained in:
parent
36f0e9919f
commit
fd33bdf8a5
5 changed files with 32 additions and 3 deletions
|
|
@ -60,7 +60,7 @@ comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function5),
|
|||
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function6),
|
||||
"""\
|
||||
Test for default args
|
||||
:type a: int
|
||||
:type a: int, optional
|
||||
:param a: Some parameter, default is 42"""
|
||||
)
|
||||
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function7),
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function5),
|
|||
comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function6),
|
||||
"""\
|
||||
Test for default args
|
||||
:type a: int
|
||||
:type a: int, optional
|
||||
:param a: Some parameter, default is 42"""
|
||||
)
|
||||
comment_verifier.check(inspect.getdoc(doxygen_basic_translate_style2.function7),
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.getAddress),
|
|||
:param fileName: name of the file, where the source line is located
|
||||
:type line: int
|
||||
:param line: line number
|
||||
:type isGetSize: boolean
|
||||
:type isGetSize: boolean, optional
|
||||
:param isGetSize: if set, for every object location both address and size are returned
|
||||
|
||||
Connection::getId() """)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue