Fix pre-commit config paths after restructure

- Update format_tables.py to use workspace-relative path (quarto/contents/)
- Update validate_part_keys.py script to use book/quarto paths
- Scripts in book/tools/ that calculate workspace_root need paths relative to book/
- Other scripts need full book/quarto/contents/ paths
This commit is contained in:
Vijay Janapa Reddi
2025-12-05 14:16:13 -08:00
parent b04feb1272
commit 1cca4139f3
2 changed files with 7 additions and 7 deletions

View File

@@ -161,7 +161,7 @@ repos:
- id: validate-footnotes
name: "Validate footnote references and definitions"
entry: python book/tools/scripts/content/footnote_cleanup.py -d book/quarto/contents/ --validate
entry: python book/tools/scripts/content/footnote_cleanup.py -d book/quarto/contents/ --validate
language: python
additional_dependencies: []
pass_filenames: false
@@ -202,7 +202,7 @@ repos:
# --- Table Formatting Validation ---
- id: check-table-formatting
name: "Check table formatting (alignment, bolding, spacing)"
entry: python book/tools/scripts/content/format_tables.py --check -d book/quarto/contents/
entry: python book/tools/scripts/content/format_tables.py --check -d quarto/contents/
language: python
additional_dependencies: []
pass_filenames: false

View File

@@ -20,9 +20,9 @@ from typing import Dict, List, Set, Tuple
def load_part_summaries() -> Dict:
"""Load part summaries from YAML file."""
yaml_path = Path("quarto/contents/parts/summaries.yml")
yaml_path = Path("book/quarto/contents/parts/summaries.yml")
if not yaml_path.exists():
print("❌ Error: quarto/contents/parts/summaries.yml not found")
print("❌ Error: book/quarto/contents/parts/summaries.yml not found")
return {}
try:
@@ -47,10 +47,10 @@ def load_part_summaries() -> Dict:
def find_qmd_files() -> List[Path]:
"""Find all .qmd files in the quarto directory."""
qmd_files = []
book_dir = Path("quarto")
book_dir = Path("book/quarto")
if not book_dir.exists():
print("❌ Error: quarto directory not found")
print("❌ Error: book/quarto directory not found")
return []
# Find all .qmd files recursively