Skip to content
Snippets Groups Projects
Commit 6b260b62 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

Merge branch 'docuratorFix' into 'develop'

empty docstring fix

See merge request !446
parents 30a4576f aecb6fbd
No related branches found
No related tags found
6 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!446empty docstring fix
Pipeline #83221 passed with stage
in 2 minutes and 49 seconds
......@@ -24,21 +24,13 @@ def doc(doc_string: str, template="saqc_methods", source="function_string"):
return docFunc
def getDocstringIndent(doc_string: list) -> str:
def getDocstringIndent(lines: list) -> str:
"""returns a whitespace string matching the indent size of the passed docstring_list"""
regular_line = False
current_line = 0
while not regular_line:
# check if line is empty
if len(doc_string[current_line]) == 0 or re.match(
" *$", doc_string[current_line]
):
current_line += 1
else:
regular_line = True
# get indent-string (smth. like " ")
indent_str = re.match(" *", doc_string[current_line])[0]
return indent_str
for line in lines:
if len(line) == 0 or re.match(" *$", line):
continue
return re.match(" *", line)[0]
return ""
def getSections(doc_string: list, indent_str: str) -> dict:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment