@@ -575,7 +575,7 @@ the `flake8 <https://pypi.org/project/flake8>`_ tool
575
575
and report any stylistic errors in your code. Therefore, it is helpful before
576
576
submitting code to run the check yourself on the diff::
577
577
578
- git diff master -u -- "*.py" | flake8 --diff
578
+ git diff upstream/ master -u -- "*.py" | flake8 --diff
579
579
580
580
This command will catch any stylistic errors in your changes specifically, but
581
581
be beware it may not catch all of them. For example, if you delete the only
@@ -584,21 +584,21 @@ unused function. However, style-checking the diff will not catch this because
584
584
the actual import is not part of the diff. Thus, for completeness, you should
585
585
run this command, though it will take longer::
586
586
587
- git diff master --name-only -- "*.py" | grep "pandas/ " | xargs -r flake8
587
+ git diff upstream/ master --name-only -- "*.py" | xargs -r flake8
588
588
589
589
Note that on OSX, the ``-r `` flag is not available, so you have to omit it and
590
590
run this slightly modified command::
591
591
592
- git diff master --name-only -- "*.py" | grep "pandas/ " | xargs flake8
592
+ git diff upstream/ master --name-only -- "*.py" | xargs flake8
593
593
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::
594
+ Windows does not support the ``xargs `` command (unless installed for example
595
+ via the `MinGW <http://www.mingw.org/ >`__ toolchain), but one can imitate the
596
+ behaviour as follows::
597
597
598
- for /f %i in ('git diff upstream/master --name-only ^| findstr pandas/ ') do flake8 %i
598
+ for /f %i in ('git diff upstream/master --name-only -- "*.py" ') do flake8 %i
599
599
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.
600
+ This will get all the files being changed by the PR (and ending with `` .py ``),
601
+ and run ``flake8 `` on them, one after the other.
602
602
603
603
.. _contributing.import-formatting :
604
604
0 commit comments