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.16.0.rst
,doc/source/whatsnew/v0.16.1.rst
&doc/source/whatsnew/v0.16.2.rst
- Remove the import block (
from pandas import *
) from the lines (8-11) of the filev0.16.*.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.16.*
doc/source/whatsnew/v0.16.0.rst:80:5: F405 'iris' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.0.rst:81:27: E251 unexpected spaces around keyword / parameter equals
doc/source/whatsnew/v0.16.0.rst:81:29: E251 unexpected spaces around keyword / parameter equals
doc/source/whatsnew/v0.16.0.rst:82:27: E251 unexpected spaces around keyword / parameter equals
doc/source/whatsnew/v0.16.0.rst:82:29: E251 unexpected spaces around keyword / parameter equals
doc/source/whatsnew/v0.16.0.rst:101:8: F405 'Series' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.0.rst:102:14: F405 'MultiIndex' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.0.rst:108:38: E127 continuation line over-indented for visual indent
doc/source/whatsnew/v0.16.0.rst:132:32: E127 continuation line over-indented for visual indent
doc/source/whatsnew/v0.16.0.rst:136:9: F405 'SparseSeries' may be undefined, or defined from star imports: pandas
...
doc/source/whatsnew/v0.16.1.rst:54:18: F405 'DataFrame' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.1.rst:54:32: E203 whitespace before ':'
doc/source/whatsnew/v0.16.1.rst:55:32: E203 whitespace before ':'
doc/source/whatsnew/v0.16.1.rst:55:35: F405 'Series' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.1.rst:57:28: E124 closing bracket does not match visual indentation
doc/source/whatsnew/v0.16.1.rst:149:30: E231 missing whitespace after ','
doc/source/whatsnew/v0.16.1.rst:158:30: E231 missing whitespace after ','
doc/source/whatsnew/v0.16.1.rst:161:45: E231 missing whitespace after ','
doc/source/whatsnew/v0.16.1.rst:161:50: E231 missing whitespace after ','
doc/source/whatsnew/v0.16.1.rst:170:45: E231 missing whitespace after ','
doc/source/whatsnew/v0.16.1.rst:170:50: E231 missing whitespace after ','
...
doc/source/whatsnew/v0.16.2.rst:49:4: F405 'f' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.2.rst:49:6: F405 'g' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.2.rst:49:8: F405 'h' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.2.rst:49:10: F405 'df' may be undefined, or defined from star imports: pandas
doc/source/whatsnew/v0.16.2.rst:56:5: F405 'df' may be undefined, or defined from star imports: pandas
...
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