Skip to content

Commit

Permalink
DOC: Patch new flake8 command grep
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gfyoung authored and mattip committed Mar 30, 2017
1 parent 901a245 commit 5a2c2f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,12 @@ unused function. However, style-checking the diff will not catch this because
the actual import is not part of the diff. Thus, for completeness, you should
run this command, though it will take longer::

git diff master --name-only -- '*.py' | grep 'pandas' | xargs -r flake8
git diff master --name-only -- '*.py' | grep 'pandas/' | xargs -r flake8

Note that on OSX, the ``-r`` flag is not available, so you have to omit it and
run this slightly modified command::

git diff master --name-only -- '*.py' | grep 'pandas/' | xargs flake8

Backwards Compatibility
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 5a2c2f9

Please sign in to comment.