Skip to content

Commit bba8b4d

Browse files
committed
Added GL08 -- no docstring found error & condition for it.
1 parent 95a6ac2 commit bba8b4d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/validate_docstrings.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
'{allowed_sections}',
7777
'GL07': 'Wrong order of sections. "{wrong_section}" should be located '
7878
'before "{goes_before}", the right order is: {sorted_sections}',
79+
'GL08': 'No docstring found',
7980
'SS01': 'No summary found (a short summary in a single line should be '
8081
'present at the beginning of the docstring)',
8182
'SS02': 'Summary does not start with a capital letter',
@@ -585,6 +586,20 @@ def validate_one(func_name):
585586

586587
errs = []
587588
wrns = []
589+
590+
if len(doc.raw_doc) == 0:
591+
errs.append(error('GL08'))
592+
return {
593+
'type': doc.type,
594+
'docstring': doc.clean_doc,
595+
'deprecated': doc.deprecated,
596+
'file': doc.source_file_name,
597+
'file_line': doc.source_file_def_line,
598+
'github_link': doc.github_url,
599+
'errors': errs,
600+
'warnings': wrns,
601+
'examples_errors': []}
602+
588603
if doc.start_blank_lines != 1:
589604
errs.append(error('GL01'))
590605
if doc.end_blank_lines != 1:

0 commit comments

Comments
 (0)