From b3be9a406992f7d71216e4d42eacde46fab811cb Mon Sep 17 00:00:00 2001 From: h-vetinari <33685575+h-vetinari@users.noreply.github.com> Date: Thu, 15 Nov 2018 13:02:33 +0100 Subject: [PATCH] DOC: flake8-per-pr for windows users (#23707) --- doc/source/contributing.rst | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst index 7eb9a6cf815ba8..b44bd1cfd90076 100644 --- a/doc/source/contributing.rst +++ b/doc/source/contributing.rst @@ -591,21 +591,14 @@ run this slightly modified command:: git diff master --name-only -- "*.py" | grep "pandas/" | xargs flake8 -Note that on Windows, these commands are unfortunately not possible because -commands like ``grep`` and ``xargs`` are not available natively. To imitate the -behavior with the commands above, you should run:: +Windows does not support the ``grep`` and ``xargs`` commands (unless installed +for example via the `MinGW `__ toolchain), but one can +imitate the behaviour as follows:: - git diff master --name-only -- "*.py" + for /f %i in ('git diff upstream/master --name-only ^| findstr pandas/') do flake8 %i -This will list all of the Python files that have been modified. The only ones -that matter during linting are any whose directory filepath begins with "pandas." -For each filepath, copy and paste it after the ``flake8`` command as shown below: - - flake8 - -Alternatively, you can install the ``grep`` and ``xargs`` commands via the -`MinGW `__ toolchain, and it will allow you to run the -commands above. +This will also get all the files being changed by the PR (and within the +``pandas/`` folder), and run ``flake8`` on them one after the other. .. _contributing.import-formatting: