Skip to content

Commit b69c877

Browse files
gfyoungjreback
authored andcommitted
DOC: Add gotcha about flake8-ing diff
The `flake8`-ing the diff will not catch any import style errors. I put an alternative check that is more comprehensive but will take longer to run since you will be checking entire files instead of the diff. Author: gfyoung <[email protected]> Closes #15712 from gfyoung/pep8-diff-gotcha and squashes the following commits: 42c13de [gfyoung] DOC: Add gotcha about flake8-ing diff
1 parent 087c2f1 commit b69c877

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/source/contributing.rst

+9
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,15 @@ submitting code to run the check yourself on the diff::
520520

521521
git diff master | flake8 --diff
522522

523+
This command will catch any stylistic errors in your changes specifically, but
524+
be beware it may not catch all of them. For example, if you delete the only
525+
usage of an imported function, it is stylistically incorrect to import an
526+
unused function. However, style-checking the diff will not catch this because
527+
the actual import is not part of the diff. Thus, for completeness, you should
528+
run this command, though it will take longer::
529+
530+
git diff master --name-only -- '*.py' | grep 'pandas' | xargs -r flake8
531+
523532
Backwards Compatibility
524533
~~~~~~~~~~~~~~~~~~~~~~~
525534

0 commit comments

Comments
 (0)