Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 942001a

Browse files
authored
DOC Update contributing guide for flake8-diff (#16758)
1 parent 104b736 commit 942001a

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ code-analysis:
6767
pylint -E -i y sklearn/ -d E1103,E0611,E1101
6868

6969
flake8-diff:
70-
./build_tools/circle/linting.sh
70+
git diff upstream/master -u -- "*.py" | flake8 --diff

doc/developers/contributing.rst

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,12 @@ Contributing code
181181
If in doubt about duplicated work, or if you want to work on a non-trivial
182182
feature, it's recommended to first open an issue in
183183
the `issue tracker <https://github.com/scikit-learn/scikit-learn/issues>`_
184-
to get some feedbacks from core developers.
185-
186-
One easy way to find an issue to work on is by applying the "help wanted"
187-
label in your search. This lists all the issues that have been unclaimed
188-
so far. In order to claim an issue for yourself, please comment exactly
189-
``take`` on it for the CI to automatically assign the issue to you.
184+
to get some feedbacks from core developers.
185+
186+
One easy way to find an issue to work on is by applying the "help wanted"
187+
label in your search. This lists all the issues that have been unclaimed
188+
so far. In order to claim an issue for yourself, please comment exactly
189+
``take`` on it for the CI to automatically assign the issue to you.
190190

191191
How to contribute
192192
-----------------
@@ -224,6 +224,8 @@ how to set up your git repository:
224224
for more details about advanced installation, see the
225225
:ref:`install_bleeding_edge` section.
226226

227+
.. _upstream:
228+
227229
6. Add the ``upstream`` remote. This saves a reference to the main
228230
scikit-learn repository, which you can use to keep your repository
229231
synchronized with the latest changes::
@@ -356,10 +358,13 @@ complies with the following rules before marking a PR as ``[MRG]``. The
356358
non-regression tests should fail for the code base in the master branch
357359
and pass for the PR code.
358360

359-
5. **Make sure that your PR does not add PEP8 violations**. On a Unix-like
360-
system, you can run `make flake8-diff`. `flake8 path_to_file`, would work
361-
for any system, but please avoid reformatting parts of the file that your
362-
pull request doesn't change, as it distracts from code review.
361+
5. **Make sure that your PR does not add PEP8 violations**. To check the
362+
code that you changed, you can run the following command (see
363+
:ref:`above <upstream>` to set up the upstream remote)::
364+
365+
git diff upstream/master -u -- "*.py" | flake8 --diff
366+
367+
or `make flake8-diff` which should work on unix-like system.
363368

364369
6. Follow the :ref:`coding-guidelines`.
365370

@@ -662,7 +667,7 @@ In general have the following in mind:
662667
4. 1D or 2D data can be a subset of
663668
``{array-like, ndarray, sparse matrix, dataframe}``. Note that ``array-like``
664669
can also be a ``list``, while ``ndarray`` is explicitly only a ``numpy.ndarray``.
665-
5. When specifying the data type of a list, use ``of`` as a delimiter:
670+
5. When specifying the data type of a list, use ``of`` as a delimiter:
666671
``list of int``.
667672
6. When specifying the dtype of an ndarray, use e.g. ``dtype=np.int32``
668673
after defining the shape:

0 commit comments

Comments
 (0)