Skip to content

Commit fc0d670

Browse files
gfyoungAnkurDedania
authored andcommitted
DOC: Patch new flake8 command grep
The grep was initially matching to "pandas," which is incorrect because that was also matching files containing "pandas" in the name but that were not in the main `pandas` directory (e.g. performance test code). This change enforces that we match to any Python files in the main `pandas` directory. Also picked up compatibility issue with OSX, in which the `-r` flag does not exist. However, `xargs` terminates if the argument list is empty, which was the whole point of passing in `-r` in the first place. Follow-up to pandas-dev#15712 Author: gfyoung <[email protected]> Closes pandas-dev#15749 from gfyoung/flake8-diff-patch and squashes the following commits: d1543b5 [gfyoung] COMPAT: Do not run xargs with -r on OSX da57857 [gfyoung] DOC: Patch new flake8 command grep
1 parent f139a77 commit fc0d670

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/source/contributing.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,12 @@ unused function. However, style-checking the diff will not catch this because
527527
the actual import is not part of the diff. Thus, for completeness, you should
528528
run this command, though it will take longer::
529529

530-
git diff master --name-only -- '*.py' | grep 'pandas' | xargs -r flake8
530+
git diff master --name-only -- '*.py' | grep 'pandas/' | xargs -r flake8
531+
532+
Note that on OSX, the ``-r`` flag is not available, so you have to omit it and
533+
run this slightly modified command::
534+
535+
git diff master --name-only -- '*.py' | grep 'pandas/' | xargs flake8
531536

532537
Backwards Compatibility
533538
~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)