Skip to content
Snippets Groups Projects
Commit 02c55dc5 authored by Vladimir Keleshev's avatar Vladimir Keleshev
Browse files

Merge pull request #36 from dpursehouse/duplicate-errors-for-docstrings

Fix duplicate reporting of docstring errors
parents b722893e 5e455597
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -184,8 +184,11 @@ def parse_module_docstring(source):
 
def parse_docstring(source, what=''):
"""Parse docstring given `def` or `class` source."""
module_docstring = parse_module_docstring(source)
if what.startswith('module'):
return parse_module_docstring(source)
return module_docstring
if module_docstring:
return module_docstring
token_gen = tk.generate_tokens(StringIO(source).readline)
try:
kind = None
Loading
Loading
@@ -266,7 +269,7 @@ def parse_contexts(source, kind):
if kind == 'def_docstring':
return parse_functions(source) + parse_methods(source)
if kind == 'docstring':
return ([source] + parse_functions(source) +
return ([parse_module_docstring(source)] + parse_functions(source) +
parse_classes(source) + parse_methods(source))
 
 
Loading
Loading
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