autoDocstring
autoDocstring copied to clipboard
Existing heredoc strings in a function will prevent autodocstring generation
Describe the bug When a heredoc format string is used anywhere in a function, this disabled the autoDocstring code form attempting to generate a docstring.
Versions (please complete the following information):
- autoDocstring Version: [0.6.1]
- Operating System: Windows 10
- Vscode Version: 1.67.2
Original Code (with line to generate on):
def addFloatParmFunction(sMultiShotSwitchNodePath):
sNewParmExpr = """
return hou.pwd().hm().evalMultiShotSwitchCustomParm(hou.evaluatingParm().path(), hou.pwd().path())
"""
# User will set name and label in generic function
oNewCustomParm = hou.FloatParmTemplate('tempName', 'Temp Label', 1, (0,), min=0, max=1.0,
join_with_next=True,
default_expression=([sNewParmExpr]), default_expression_language=([hou.scriptLanguage.Python]),
help="")
addParmFunctionGeneric(sMultiShotSwitchNodePath, oNewCustomParm)
Expected Result:
def addFloatParmFunction(sMultiShotSwitchNodePath):
"""Shared function when adding any custom MultiShot Parm.
Args:
sMultiShotSwitchNodePath (string): The path to the MultiShot Switch node.
"""
sNewParmExpr = """
return hou.pwd().hm().evalMultiShotSwitchCustomParm(hou.evaluatingParm().path(), hou.pwd().path())
"""
# User will set name and label in generic function
oNewCustomParm = hou.FloatParmTemplate('tempName', 'Temp Label', 1, (0,), min=0, max=1.0,
join_with_next=True,
default_expression=([sNewParmExpr]), default_expression_language=([hou.scriptLanguage.Python]),
help="")
addParmFunctionGeneric(sMultiShotSwitchNodePath, oNewCustomParm)
Actual Result:
def addFloatParmFunction(sMultiShotSwitchNodePath):
sNewParmExpr = """
return hou.pwd().hm().evalMultiShotSwitchCustomParm(hou.evaluatingParm().path(), hou.pwd().path())
"""
# User will set name and label in generic function
oNewCustomParm = hou.FloatParmTemplate('tempName', 'Temp Label', 1, (0,), min=0, max=1.0,
join_with_next=True,
default_expression=([sNewParmExpr]), default_expression_language=([hou.scriptLanguage.Python]),
help="")
addParmFunctionGeneric(sMultiShotSwitchNodePath, oNewCustomParm)