@@ -509,7 +509,7 @@ the `flake8 <http://pypi.python.org/pypi/flake8>`_ tool
509
509
and report any stylistic errors in your code. Therefore, it is helpful before
510
510
submitting code to run the check yourself on the diff::
511
511
512
- git diff master --name-only -- ' *.py' | flake8 --diff
512
+ git diff master -u -- " *.py" | flake8 --diff
513
513
514
514
This command will catch any stylistic errors in your changes specifically, but
515
515
be beware it may not catch all of them. For example, if you delete the only
@@ -518,18 +518,28 @@ unused function. However, style-checking the diff will not catch this because
518
518
the actual import is not part of the diff. Thus, for completeness, you should
519
519
run this command, though it will take longer::
520
520
521
- git diff master --name-only -- ' *.py' | grep ' pandas/' | xargs -r flake8
521
+ git diff master --name-only -- " *.py" | grep " pandas/" | xargs -r flake8
522
522
523
523
Note that on OSX, the ``-r `` flag is not available, so you have to omit it and
524
524
run this slightly modified command::
525
525
526
- git diff master --name-only -- ' *.py' | grep ' pandas/' | xargs flake8
526
+ git diff master --name-only -- " *.py" | grep " pandas/" | xargs flake8
527
527
528
- Note that on Windows, `` grep ``, `` xargs ``, and other tools are likely
529
- unavailable. However, this has been shown to work on smaller commits in the
530
- standard Windows command line ::
528
+ Note that on Windows, these commands are unfortunately not possible because
529
+ commands like `` grep `` and `` xargs `` are not available natively. To imitate the
530
+ behavior with the commands above, you should run ::
531
531
532
- git diff master -u -- "*.py" | flake8 --diff
532
+ git diff master --name-only -- "*.py"
533
+
534
+ This will list all of the Python files that have been modified. The only ones
535
+ that matter during linting are any whose directory filepath begins with "pandas."
536
+ For each filepath, copy and paste it after the ``flake8 `` command as shown below:
537
+
538
+ flake8 <python-filepath>
539
+
540
+ Alternatively, you can install the ``grep `` and ``xargs `` commands via the
541
+ `MinGW <http://www.mingw.org/ >`__ toolchain, and it will allow you to run the
542
+ commands above.
533
543
534
544
Backwards Compatibility
535
545
~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments