@@ -261,7 +261,7 @@ how to set up your git repository:
261
261
262
262
.. prompt :: bash $
263
263
264
- pip install cython pytest pytest-cov flake8 mypy
264
+ pip install cython pytest pytest-cov flake8 mypy black==21.6b0
265
265
266
266
5. Install scikit-learn in editable mode:
267
267
@@ -433,7 +433,17 @@ complies with the following rules before marking a PR as ``[MRG]``. The
433
433
non-regression tests should fail for the code base in the ``main `` branch
434
434
and pass for the PR code.
435
435
436
- 5. **Make sure that your PR does not add PEP8 violations **. To check the
436
+ 5. Run `black ` to auto-format your code.
437
+
438
+ .. prompt :: bash $
439
+
440
+ black .
441
+
442
+ See black's
443
+ `editor integration documentation <https://black.readthedocs.io/en/stable/integrations/editors.html >`_
444
+ to configure your editor to run `black `.
445
+
446
+ 6. **Make sure that your PR does not add PEP8 violations **. To check the
437
447
code that you changed, you can run the following command (see
438
448
:ref: `above <upstream >` to set up the ``upstream `` remote):
439
449
@@ -443,14 +453,14 @@ complies with the following rules before marking a PR as ``[MRG]``. The
443
453
444
454
or `make flake8-diff ` which should work on unix-like system.
445
455
446
- 6 . Follow the :ref: `coding-guidelines `.
456
+ 7 . Follow the :ref: `coding-guidelines `.
447
457
448
458
449
- 7 . When applicable, use the validation tools and scripts in the
459
+ 8 . When applicable, use the validation tools and scripts in the
450
460
``sklearn.utils `` submodule. A list of utility routines available
451
461
for developers can be found in the :ref: `developers-utils ` page.
452
462
453
- 8 . Often pull requests resolve one or more other issues (or pull requests).
463
+ 9 . Often pull requests resolve one or more other issues (or pull requests).
454
464
If merging your pull request means that some other issues/PRs should
455
465
be closed, you should `use keywords to create link to them
456
466
<https://github.com/blog/1506-closing-issues-via-pull-requests/> `_
@@ -460,23 +470,23 @@ complies with the following rules before marking a PR as ``[MRG]``. The
460
470
related to some other issues/PRs, create a link to them without using
461
471
the keywords (e.g., ``See also #1234 ``).
462
472
463
- 9 . PRs should often substantiate the change, through benchmarks of
464
- performance and efficiency (see :ref: `monitoring_performances `) or through
465
- examples of usage. Examples also illustrate the features and intricacies of
466
- the library to users. Have a look at other examples in the `examples/
467
- <https://github.com/scikit-learn/scikit-learn/tree/main/examples> `_
468
- directory for reference. Examples should demonstrate why the new
469
- functionality is useful in practice and, if possible, compare it to other
470
- methods available in scikit-learn.
473
+ 10 . PRs should often substantiate the change, through benchmarks of
474
+ performance and efficiency (see :ref: `monitoring_performances `) or through
475
+ examples of usage. Examples also illustrate the features and intricacies of
476
+ the library to users. Have a look
E864
at other examples in the `examples/
477
+ <https://github.com/scikit-learn/scikit-learn/tree/main/examples> `_
478
+ directory for reference. Examples should demonstrate why the new
479
+ functionality is useful in practice and, if possible, compare it to other
480
+ methods available in scikit-learn.
471
481
472
- 10 . New features have some maintenance overhead. We expect PR authors
482
+ 11 . New features have some maintenance overhead. We expect PR authors
473
483
to take part in the maintenance for the code they submit, at least
474
484
initially. New features need to be illustrated with narrative
475
485
documentation in the user guide, with small code snippets.
476
486
If relevant, please also add references in the literature, with PDF links
477
487
when possible.
478
488
479
- 11 . The user guide should also include expected time and space complexity
489
+ 12 . The user guide should also include expected time and space complexity
480
490
of the algorithm and scalability, e.g. "this algorithm can scale to a
481
491
large number of samples > 100000, but does not scale in dimensionality:
482
492
n_features is expected to be lower than 100".
@@ -1357,3 +1367,13 @@ make this task easier and faster (in no particular order).
1357
1367
<https://git-scm.com/docs/git-grep#_examples> `_) is also extremely
1358
1368
useful to see every occurrence of a pattern (e.g. a function call or a
1359
1369
variable) in the code base.
1370
+
1371
+ - Configure `git blame ` to ignore the commit that migrated the code style to
1372
+ `black `.
1373
+
1374
+ .. prompt :: bash $
1375
+
1376
+ git config blame.ignoreRevsFile .git-blame-ignore-revs
1377
+
1378
+ Find out more information in black's
1379
+ `documentation for avoiding ruining git blame <https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html#avoiding-ruining-git-blame >`_.
0 commit comments