@@ -490,6 +490,9 @@ being rendered properly) and it also validates the doctests. It is possible to
490
490
run the checks independently by using the parameters ``lint ``, ``patterns `` and
491
491
``doctests `` (e.g. ``./ci/code_checks.sh lint ``).
492
492
493
+ We recommend using :ref: `contributing.pre_commit `. These will run a few fast
494
+ checks each time you make a commit.
495
+
493
496
In addition, because a lot of people use our library, it is important that we
494
497
do not make sudden changes to the code that could have the potential to break
495
498
a lot of user code as a result, that is, we need it to be as *backwards compatible *
@@ -650,6 +653,19 @@ The `--recursive` flag can be passed to sort all files in a directory.
650
653
651
654
You can then verify the changes look ok, then git :ref: `commit <contributing.commit-code >` and :ref: `push <contributing.push-code >`.
652
655
656
+ .. _contributing.pre_commit :
657
+
658
+ Pre-Commit Hooks
659
+ ~~~~~~~~~~~~~~~~
660
+
661
+ Install the `pre commit <https://github.com/pre-commit/pre-commit >`_ tool. Then, from the
662
+ root of the ``pandas `` repository, run ``pre-commit install `` to install a few plugins
663
+ like black, isort, and flake8. These tools will automatically be run on each commit. If the
664
+ tool reformats automatically (black, isort) then you can preview the changes before before
665
+ staging and committing with ``git diff ``.
666
+
667
+ You can skip the checks with ``git commit --no-verify ``.
668
+
653
669
Backwards compatibility
654
670
~~~~~~~~~~~~~~~~~~~~~~~
655
671
0 commit comments