Skip to content

Commit f81f2b1

Browse files
h-vetinariPingviinituutti
authored andcommitted
DOC: flake8-per-pr for windows users (pandas-dev#23707)
1 parent 6dd5dc0 commit f81f2b1

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

doc/source/contributing.rst

+6-13
Original file line numberDiff line numberDiff line change
@@ -591,21 +591,14 @@ run this slightly modified command::
591591

592592
git diff master --name-only -- "*.py" | grep "pandas/" | xargs flake8
593593

594-
Note that on Windows, these commands are unfortunately not possible because
595-
commands like ``grep`` and ``xargs`` are not available natively. To imitate the
596-
behavior with the commands above, you should run::
594+
Windows does not support the ``grep`` and ``xargs`` commands (unless installed
595+
for example via the `MinGW <http://www.mingw.org/>`__ toolchain), but one can
596+
imitate the behaviour as follows::
597597

598-
git diff master --name-only -- "*.py"
598+
for /f %i in ('git diff upstream/master --name-only ^| findstr pandas/') do flake8 %i
599599

600-
This will list all of the Python files that have been modified. The only ones
601-
that matter during linting are any whose directory filepath begins with "pandas."
602-
For each filepath, copy and paste it after the ``flake8`` command as shown below:
603-
604-
flake8 <python-filepath>
605-
606-
Alternatively, you can install the ``grep`` and ``xargs`` commands via the
607-
`MinGW <http://www.mingw.org/>`__ toolchain, and it will allow you to run the
608-
commands above.
600+
This will also get all the files being changed by the PR (and within the
601+
``pandas/`` folder), and run ``flake8`` on them one after the other.
609602

610603
.. _contributing.import-formatting:
611604

0 commit comments

Comments
 (0)