diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd5f95c8..81114139 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: check-toml - id: check-merge-conflict - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.3 + rev: v0.8.4 hooks: - id: ruff args: [--fix, --show-fixes] @@ -21,7 +21,7 @@ repos: - id: pretty-format-toml args: [--autofix] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.13.0 + rev: v1.14.0 hooks: - id: mypy args: [--strict, --ignore-missing-imports] @@ -50,13 +50,13 @@ repos: types: [jupyter] additional_dependencies: [nbformat] - repo: https://github.com/executablebooks/mdformat - rev: 0.7.18 + rev: 0.7.21 hooks: - id: mdformat additional_dependencies: - mdformat-gfm - repo: https://github.com/kynan/nbstripout - rev: 0.8.0 + rev: 0.8.1 hooks: - id: nbstripout args: [--drop-empty-cells, --keep-count, --keep-output, --extra-keys, metadata.kernelspec] diff --git a/README.md b/README.md index c6fe7892..585b3d8b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # c3s2-eqc-quality-assessment -> \[!WARNING\] +> [!WARNING] > Please note that this repository is used for development and review, so quality assessments should be considered work in progress until they are merged into the main branch -> \[!NOTE\]\ +> [!NOTE] > If anything is unclear with the templates, or if you encounter any problems, please report them at [GH164](https://github.com/ecmwf-projects/c3s2-eqc-quality-assessment/issues/164). ## Quick start diff --git a/scripts/pre-build.py b/scripts/pre-build.py index bde64c97..9d794a53 100644 --- a/scripts/pre-build.py +++ b/scripts/pre-build.py @@ -16,7 +16,7 @@ def get_disclaimer(readme: Path) -> str: lines = readme.open() disclaimer = ['
'] for line in lines: - if line.startswith(r"> \[!WARNING\]"): + if line.startswith("> [!WARNING]"): for line in lines: if line.startswith(">"): disclaimer.append(line.removeprefix(">").strip()) diff --git a/scripts/validate-headings.py b/scripts/validate-headings.py index 491e27e6..94ebeddf 100644 --- a/scripts/validate-headings.py +++ b/scripts/validate-headings.py @@ -20,6 +20,7 @@ def validate_headers(path: Path) -> None: title_count = 0 admonition_count = 0 + admonition_is_note = False headings_count = dict.fromkeys(HEADINGS, 0) for cell in notebook.cells: if cell["cell_type"] != "markdown": @@ -32,6 +33,9 @@ def validate_headers(path: Path) -> None: title_count += 1 elif line == f"```{{admonition}} {ADMONITION_TITLE}": admonition_count += 1 + elif admonition_count and not admonition_is_note: + admonition_is_note = line.startswith(":class: note") + assert admonition_is_note, f"{path=!s}: The admonition is not a note" if not path.name.startswith("template"): assert title_count, f"{path=!s}: The first line is not a title."