new file mode 100644
@@ -0,0 +1,8 @@
+repos:
+ - repo: local
+ hooks:
+ - id: check-glossaries
+ name: Check glossaries alphabetical order
+ entry: ./documentation/tools/check-glossaries
+ language: python
+ pass_filenames: false
@@ -89,6 +89,16 @@ generated with DocBook.
How to build the Yocto Project documentation
============================================
+If possible, install pre-commit hooks to make sure you did not miss any
+updates that are run automatically:
+
+ $ pre-commit install
+
+The pre-commit project can be installed on your host using your package manager,
+usually under the name "pre-commit", e.g.:
+
+ $ sudo apt-get install pre-commit
+
To build the documentation, you need Sphinx and a few other packages,
which depend on your host GNU/Linux distribution. Such packages are listed on
https://docs.yoctoproject.org/dev/ref-manual/system-requirements.html#required-packages-for-the-build-host
It is easy to badly order the glossaries or forget to update the list at the beginning of the variables.rst file. Add a pre-commit hook that does it for us, and update the README to mention to enable it. Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> --- .pre-commit-config.yaml | 8 ++++++++ documentation/README | 10 ++++++++++ 2 files changed, 18 insertions(+)