From 28c56488994c7ecb86a77aabf3a282958e49bad6 Mon Sep 17 00:00:00 2001 From: Mattia Almansi Date: Wed, 30 Oct 2024 15:47:17 +0100 Subject: [PATCH] improve pre-commit script (#255) --- scripts/validate-headings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/validate-headings.py b/scripts/validate-headings.py index 07400b07..491e27e6 100644 --- a/scripts/validate-headings.py +++ b/scripts/validate-headings.py @@ -12,6 +12,8 @@ "## ℹ️ If you want to know more", ) +ADMONITION_TITLE = "These are the key outcomes of this assessment" + def validate_headers(path: Path) -> None: notebook = nbformat.read(path, nbformat.NO_CONVERT) @@ -28,9 +30,7 @@ def validate_headers(path: Path) -> None: if line.startswith("# "): title_count += 1 - elif ( - line == "```{admonition} These are the key outcomes of this assessment" - ): + elif line == f"```{{admonition}} {ADMONITION_TITLE}": admonition_count += 1 if not path.name.startswith("template"):