Skip to content

Commit eda4064

Browse files
h-vetinariPingviinituutti
authored andcommitted
DOC: more consistent flake8-commands in contributing.rst (pandas-dev#23724)
1 parent 80e1c61 commit eda4064

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build: clean_pyc
1313
python setup.py build_ext --inplace
1414

1515
lint-diff:
16-
git diff master --name-only -- "*.py" | grep -E "pandas|scripts" | xargs flake8
16+
git diff upstream/master --name-only -- "*.py" | xargs flake8
1717

1818
develop: build
1919
-python setup.py develop

doc/source/contributing.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ the `flake8 <https://pypi.org/project/flake8>`_ tool
575575
and report any stylistic errors in your code. Therefore, it is helpful before
576576
submitting code to run the check yourself on the diff::
577577

578-
git diff master -u -- "*.py" | flake8 --diff
578+
git diff upstream/master -u -- "*.py" | flake8 --diff
579579

580580
This command will catch any stylistic errors in your changes specifically, but
581581
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
584584
the actual import is not part of the diff. Thus, for completeness, you should
585585
run this command, though it will take longer::
586586

587-
git diff master --name-only -- "*.py" | grep "pandas/" | xargs -r flake8
587+
git diff upstream/master --name-only -- "*.py" | xargs -r flake8
588588

589589
Note that on OSX, the ``-r`` flag is not available, so you have to omit it and
590590
run this slightly modified command::
591591

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

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::
597597

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
599599

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.
602602

603603
.. _contributing.import-formatting:
604604

0 commit comments

Comments
 (0)