Skip to content

Commit

Permalink
add pre-commit setup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
akcano committed Feb 18, 2025
1 parent 3b47efb commit d5a412b
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion docs/content/set-up.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ If you already have a project, download the following files locally and copy the
* the entire :file:`docs` directory
* :file:`.readthedocs.yaml` (configuration for the building on Read the Docs)
* :file:`.wokeignore` (configuration for the Woke tool)
* the entire :file:`.github/workflows` directory
* the entire :file:`.github/workflows` directory

Then, you **must** delete :file:`.github/workflows/test-starter-pack.yml`.

Expand All @@ -42,3 +42,32 @@ Configure settings
==================

Work through the settings in :file:`docs/conf.py`. Most parameters can be left with the default values as they can be changed later. :ref:`customise` contains further guidance.


Pre-commit hooks (optional)
===========================

Use `pre-commit <https://pre-commit.com/>`_ hooks with the starter pack
to automate checks like spelling and inclusive language.

The starter pack includes a ready-to-use :file:`.pre-commit-config.yaml` file:

.. literalinclude:: ../../.pre-commit-config.yaml
:language: yaml

For a new project, copy this file to your project's root directory;
for an existing project using ``pre-commit``,
add these hooks to your configuration.

To apply the configuration, install the starter pack hooks::

pre-commit install


After that, you should see the checks running with every commit::

git commit -m 'add spelling errors'

Run make spelling.......................................................Failed
Run make linkcheck......................................................Passed
Run make woke...........................................................Passed

0 comments on commit d5a412b

Please sign in to comment.