Skip to content

DOC: Fix flake8 issues in doc/source/whatsnew/v0.19.0.rst  #24219

Closed
@saurav2608

Description

@saurav2608

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

  1. Edit setup.cfg in the pandas home, and in the flake8-rst section, remove from the exclude list the file doc/source/whatsnew/v0.24.0.rst
  2. Remove the import block ( from pandas import *) from the lines (8-11) of the file v0.24.0.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.19.0.rst 
ource/whatsnew/v0.19.0.rst:141:83: E501 line too long (81 > 79 characters)
source/whatsnew/v0.19.0.rst:162:10: F821 undefined name 'DataFrame'
source/whatsnew/v0.19.0.rst:163:25: E251 unexpected spaces around keyword / parameter equals
source/whatsnew/v0.19.0.rst:163:27: E251 unexpected spaces around keyword / parameter equals
source/whatsnew/v0.19.0.rst:317:5: F821 undefined name 'Timestamp'
source/whatsnew/v0.19.0.rst:325:5: F821 undefined name 'Timestamp'
source/whatsnew/v0.19.0.rst:365:40: E127 continuation line over-indented for visual indent
source/whatsnew/v0.19.0.rst:375:19: W605 invalid escape sequence '\d'
source/whatsnew/v0.19.0.rst:451:13: E201 whitespace after '['
source/whatsnew/v0.19.0.rst:451:60: E202 whitespace before ']'
source/whatsnew/v0.19.0.rst:479:33: E126 continuation line over-indented for hanging indent
source/whatsnew/v0.19.0.rst:479:35: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:479:37: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:479:39: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:479:41: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:481:29: E126 continuation line over-indented for hanging indent
source/whatsnew/v0.19.0.rst:481:39: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:545:20: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:545:22: E231 missing whitespace after ','
source/whatsnew/v0.19.0.rst:1004:92: E501 line too long (95 > 79 characters)
source/whatsnew/v0.19.0.rst:1012:84: E501 line too long (95 > 79 characters)
source/whatsnew/v0.19.0.rst:1061:91: E501 line too long (86 > 79 characters)
source/whatsnew/v0.19.0.rst:1072:83: E501 line too long (86 > 79 characters)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions