Skip to content

Commit

Permalink
improve pre-commit script (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 authored Oct 30, 2024
1 parent 481d97f commit 28c5648
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/validate-headings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"):
Expand Down

0 comments on commit 28c5648

Please sign in to comment.