PyCQA / pydocstyle

docstring style checker
http://pydocstyle.org
MIT License
1.11k stars 189 forks source link

AttributeError: 'ClassDef' object has no attribute 'args'](url) #435

Closed ucabsdp closed 4 years ago

ucabsdp commented 4 years ago

Running release 5.0.0 on Travis:

Traceback (most recent call last): File "/opt/python/3.6.7/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/opt/python/3.6.7/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/main.py", line 19, in main() File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/main.py", line 15, in main cli.main() File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/cli.py", line 68, in main sys.exit(run_pydocstyle()) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/cli.py", line 45, in run_pydocstyle ignore_decorators=ignore_decorators)) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 968, in check ignore_decorators): File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 123, in check_source for error in errors: File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 916, in check_docstring_sections yield from self._check_google_sections(lines, definition, docstring) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 902, in _check_google_sections yield from self._check_google_section(docstring, definition, ctx) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 795, in _check_google_section yield from cls._check_args_section(docstring, definition, context) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 748, in _check_args_section yield from ConventionChecker._check_missing_args(docstring_args, definition) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 761, in _check_missing_args function_args = get_function_args(definition.source) File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/pydocstyle/checker.py", line 1001, in get_function_args function_arg_node = ast.parse(textwrap.dedent(function_string)).body[0].args AttributeError: 'ClassDef' object has no attribute 'args'](url)

Nurdok commented 4 years ago

Thanks for reporting this! Closing as a diff of #434, check for updates there.