Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: flake8-per-pr for windows users #23707

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.mingw.org/>`__ 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 <python-filepath>

Alternatively, you can install the ``grep`` and ``xargs`` commands via the
`MinGW <http://www.mingw.org/>`__ 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:

Expand Down