From: Antonin Godard <antonin.godard@bootlin.com>
To: docs@lists.yoctoproject.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Antonin Godard <antonin.godard@bootlin.com>
Subject: [PATCH 1/3] tools/check-glossaries: return 1 in case of failure
Date: Thu, 02 Jul 2026 15:59:10 +0200 [thread overview]
Message-ID: <20260702-pre-commit-v1-1-0ebd211b5d5e@bootlin.com> (raw)
In-Reply-To: <20260702-pre-commit-v1-0-0ebd211b5d5e@bootlin.com>
Exit with 1 in case there's an issue with the glossaries. This will be
used in the next commit.
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
documentation/tools/check-glossaries | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/documentation/tools/check-glossaries b/documentation/tools/check-glossaries
index b5dfe834e..9f1a47126 100755
--- a/documentation/tools/check-glossaries
+++ b/documentation/tools/check-glossaries
@@ -4,6 +4,7 @@ import argparse
import difflib
import os
import re
+import sys
from pathlib import Path
@@ -33,6 +34,7 @@ def main():
# :term:`A <ABIEXTENSION>` :term:`B` :term:`C <CACHE>`
glossary_re = re.compile(r":term:`(?P<letter>[A-Z]{1})( <(?P<varname>[A-Z_]+)>)?`")
entry_re = re.compile(r"^ :term:`(?P<entry>.+)`\s*$")
+ exit_code = 0
for rst in glossaries:
@@ -74,6 +76,7 @@ def main():
if diffs:
print(f"WARNING: {rst}: entries are not properly sorted:")
print('\n'.join(diffs))
+ exit_code = 1
for letter in glossary:
try:
@@ -81,9 +84,13 @@ def main():
except ValueError:
print(f"WARNING: {rst}: variable "
f"{glossary[letter]} in glossary does not exist")
+ exit_code = 1
if index > 0 and entries[index - 1].startswith(letter[0]):
print(f"WARNING: {rst}: The variable {glossary[letter]} shouldn't be in "
"the glossary.")
+ exit_code = 1
+
+ sys.exit(exit_code)
if __name__ == "__main__":
--
2.54.0
next prev parent reply other threads:[~2026-07-02 13:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 13:59 [PATCH 0/3] Add pre-commit support Antonin Godard
2026-07-02 13:59 ` Antonin Godard [this message]
2026-07-03 10:17 ` [docs] [PATCH 1/3] tools/check-glossaries: return 1 in case of failure Quentin Schulz
2026-07-02 13:59 ` [PATCH 2/3] tools/check-glossaries: fix default doc path Antonin Godard
2026-07-03 10:22 ` [docs] " Quentin Schulz
2026-07-03 11:34 ` Antonin Godard
2026-07-02 13:59 ` [PATCH 3/3] Add a pre-commit hook to check the glossaries Antonin Godard
2026-07-03 10:53 ` [docs] " Quentin Schulz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260702-pre-commit-v1-1-0ebd211b5d5e@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=docs@lists.yoctoproject.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.