PyCQA / pydocstyle

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

pycodestyle is not compatible with `PYTHONOPTIMIZE=2` #606

Open mondeja opened 2 years ago

mondeja commented 2 years ago

pycodestyle relies on function doctrings to show the linting errors. When you run a program with PYTHONOPTIMIZE=2 environment variable or the -OO option the docstrings are stripped, so the next error is raised:

... (traceback)

  File "/.../site-packages/pydocstyle/checker.py", line 160, in check_source
    partition = this_check.__doc__.partition('.\n')
AttributeError: 'NoneType' object has no attribute 'partition'