Skip to content

Commit 65ca911

Browse files
committed
docs(pre-commit): fix rstcheck violations & add pre-commit info
1 parent 561c2c8 commit 65ca911

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

docs/CONTRIBUTING.rst

+17-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The entire process relies on the structure of commit messages to determine the v
3232
Full details are available in the upstream docs regarding the `Angular Commit Message Conventions <https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines>`_.
3333
The key factor is that the first line of the commit message must follow this format:
3434

35-
.. code-block::
35+
.. code-block:: console
3636
3737
type(scope): subject
3838
@@ -55,6 +55,22 @@ So based on the example above:
5555
* The ``(scope):`` will be shown in bold text without the brackets.
5656
* The ``subject`` follows the ``scope`` as standard text.
5757

58+
pre-commit
59+
^^^^^^^^^^
60+
61+
`pre-commit <https://pre-commit.com/>`_ is configured for this formula, which you may
62+
optionally use to ease the steps involved in submitting your changes, including
63+
checking the formatting of your commit messages.
64+
65+
First install the ``pre-commit`` package manager locally using the appropriate
66+
`method <https://pre-commit.com/#installation>`_, then run ``bin/install-hooks`` in the
67+
formula's root directory and now ``pre-commit`` will run automatically on each
68+
``git commit``. ::
69+
70+
$ bin/install-hooks
71+
pre-commit installed at .git/hooks/pre-commit
72+
pre-commit installed at .git/hooks/commit-msg
73+
5874
Linting commit messages in Travis CI
5975
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6076

docs/TOFS_pattern.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Example: NTP before applying TOFS
6464

6565
Let's work with the NTP example. A basic formula that follows the `design guidelines <http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html>`_ has the following files and directories tree:
6666

67-
.. code-block::
67+
.. code-block:: console
6868
6969
/srv/saltstack/salt-formulas/ntp-saltstack-formula/
7070
ntp/
@@ -226,7 +226,7 @@ We can make different templates coexist for different minions, classified by any
226226

227227
If we decide that we want ``os_family`` as switch, then we could provide the formula template variants for both the ``RedHat`` and ``Debian`` families.
228228

229-
.. code-block::
229+
.. code-block:: console
230230
231231
/srv/saltstack/salt-formulas/ntp-saltstack-formula/ntp/files/
232232
default/
@@ -449,7 +449,7 @@ Using sub-directories for ``components``
449449

450450
If your formula is composed of several components, you may prefer to provides files under sub-directories, like in the `systemd-formula <https://github.com/saltstack-formulas/systemd-formula>`_.
451451

452-
.. code-block::
452+
.. code-block:: console
453453
454454
/srv/saltstack/systemd-formula/
455455
systemd/

0 commit comments

Comments
 (0)