From fc0d670ccf4994d09a7592d03c9cfa29244ffb7e Mon Sep 17 00:00:00 2001 From: gfyoung Date: Mon, 20 Mar 2017 15:38:35 -0400 Subject: [PATCH] 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 #15712 Author: gfyoung Closes #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 --- doc/source/contributing.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst index 7961780d0c79b..7ad5916a8809d 100644 --- a/doc/source/contributing.rst +++ b/doc/source/contributing.rst @@ -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 ~~~~~~~~~~~~~~~~~~~~~~~