diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst index 514a58456bcd9..88a159a23c29a 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: