Description
xref: #24177
We didn't start validating the format of PEP8 and other code standards in the documentation examples until recently. We still have some files with errors, that we need to skip, and that we should fix, so we can start validating them.
Two steps are required to replicate the issue
-
Edit
setup.cfg
in the pandas home, and in the flake8-rst section, remove from theexclude
list the filedoc/source/whatsnew/v0.14.0.rst
&doc/source/whatsnew/v0.14.1.rst
-
Remove the import block (
from pandas import *
) from the lines (8-11) of the filev0.14.*.rst
.
After that, running the next command will report the errors in the file (note that syntax error usually prevent to validate other errors, and the list of errors to fix can become much longer when the syntax error is fixed (please make sure that you are using flake8-rst
version 0.7.0 or higher):
$ flake8-rst doc/source/whatsnew/v0.14.*
doc/source/whatsnew/v0.14.0.rst:62:39: E231 missing whitespace after ','
doc/source/whatsnew/v0.14.0.rst:62:42: E231 missing whitespace after ','
doc/source/whatsnew/v0.14.0.rst:64:16: E231 missing whitespace after ','
doc/source/whatsnew/v0.14.0.rst:65:16: E231 missing whitespace after ','
doc/source/whatsnew/v0.14.0.rst:72:17: E231 missing whitespace after ','
doc/source/whatsnew/v0.14.0.rst:72:19: E231 missing whitespace after ','
doc/source/whatsnew/v0.14.0.rst:73:36: E999 SyntaxError: invalid syntax
doc/source/whatsnew/v0.14.0.rst:73:45: E226 missing whitespace around arithmetic operator
doc/source/whatsnew/v0.14.0.rst:73:48: E226 missing whitespace around arithmetic operator
...
doc/source/whatsnew/v0.14.1.rst:103:16: F821 undefined name 'Timestamp'
doc/source/whatsnew/v0.14.1.rst:106:16: F821 undefined name 'Timestamp'
doc/source/whatsnew/v0.14.1.rst:126:12: F821 undefined name 'date_range'
Once all the errors are addressed, please open a pull request with the fixes in the file, and removing the file from setup.cfg. If you need to do something that feels wrong to fix an error, please ask in a comment to this issue. Please avoid other unrelated changes, which can be addressed in a separate pull request.
cc: @datapythonista