@@ -635,6 +635,8 @@ many errors as possible, but it may not correct *all* of them. Thus, it is
635635recommended that you run ``cpplint `` to double check and make any other style
636636fixes manually.
637637
638+ .. _contributing.code-formatting :
639+
638640Python (PEP8 / black)
639641~~~~~~~~~~~~~~~~~~~~~
640642
@@ -656,6 +658,9 @@ apply ``black`` as you edit files.
656658You should use a ``black `` version >= 19.10b0 as previous versions are not compatible
657659with the pandas codebase.
658660
661+ If you wish to run these checks automatically, we encourage you to use
662+ :ref: `pre-commits <contributing.pre-commit >` instead.
663+
659664One caveat about ``git diff upstream/master -u -- "*.py" | flake8 --diff ``: this
660665command will catch any stylistic errors in your changes specifically, but
661666be beware it may not catch all of them. For example, if you delete the only
@@ -727,14 +732,16 @@ to automatically format imports correctly. This will modify your local copy of t
727732
728733The `--recursive ` flag can be passed to sort all files in a directory.
729734
730- Alternatively, you can run a command similar to what was suggested for ``black `` and ``flake8 `` right above::
735+ Alternatively, you can run a command similar to what was suggested for ``black `` and ``flake8 `` :ref: ` right above < contributing.code-formatting >` ::
731736
732737 git diff upstream/master --name-only -- "*.py" | xargs -r isort
733738
734739Where similar caveats apply if you are on OSX or Windows.
735740
736741You can then verify the changes look ok, then git :ref: `commit <contributing.commit-code >` and :ref: `push <contributing.push-code >`.
737742
743+ .. _contributing.pre-commit :
744+
738745Pre-Commit
739746~~~~~~~~~~
740747
0 commit comments