Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion getting-started/pull-request-lifecycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ You should have already :ref:`set up your system <setup>`,

(Learn more about :ref:`good-commits`)

* Then push your work to your GitHub fork::
* If your code isn't linted correctly, :ref:`pre-commit <install-pre-commit>`
will block the commit with an error message, for example::

Doc/library/stdtypes.rst:5718: No newline at end of file. (missing-final-newline)

* Once all linting errors have been fixed, you can push your work to your GitHub fork::

git push origin <branch-name>

Expand Down
12 changes: 12 additions & 0 deletions getting-started/setup-building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ affected files as described below.)
Patches for the documentation can be made from the same repository; see
:ref:`documenting`.

.. _install-pre-commit:

Install pre-commit as a Git hook
--------------------------------

To make sure your code is linted correctly, we recommend setting up
`pre-commit <https://pre-commit.com#installation>`_ as a Git hook::

$ pre-commit install --allow-missing-config
pre-commit installed at .git/hooks/pre-commit

Now pre-commit will run automatically on ``git commit``.

.. _compiling:

Expand Down