mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-03-11 17:49:25 -05:00
refactor(tools): reorganize scripts directory structure for better maintainability
Consolidated 21 root-level scripts into logical subdirectories: New structure: - images/: All image management scripts (10 files consolidated from 3 locations) - infrastructure/: CI/CD and container scripts (3 files) - content/: Added formatting scripts (3 files moved from root) - testing/: All test scripts (5 files consolidated) - glossary/: Added standardize_glossaries.py - maintenance/: Added generate_release_notes.py, preflight.py - utilities/: Added validation scripts Benefits: - Reduced root-level clutter (21 → 2 files) - Related scripts grouped logically - Easier to find and maintain scripts - Follows standard project organization patterns Changes: - Created new subdirectories: images/, infrastructure/ - Moved scripts from root to appropriate subdirectories - Consolidated scattered scripts (images were in 3 places) - Updated all pre-commit hook references - Created README files for new directories - Included backup file for rollback if needed Tool: tools/scripts/reorganize_scripts.py (for future reference)
This commit is contained in:
@@ -59,12 +59,21 @@ repos:
|
||||
|
||||
- id: format-python-in-qmd
|
||||
name: "Format Python code blocks (Black, 70 chars)"
|
||||
entry: python tools/scripts/format_python_in_qmd.py
|
||||
entry: python tools/scripts/content/format_python_in_qmd.py
|
||||
language: python
|
||||
additional_dependencies: [black>=23.0.0]
|
||||
pass_filenames: true
|
||||
files: ^quarto/contents/.*\.qmd$
|
||||
|
||||
- id: check-list-formatting
|
||||
name: "Fix markdown list formatting (require blank line before lists)"
|
||||
entry: python tools/scripts/utilities/check_list_formatting.py --fix
|
||||
language: python
|
||||
additional_dependencies: []
|
||||
pass_filenames: true
|
||||
files: \.qmd$
|
||||
description: "Ensure bullet lists are preceded by blank lines for proper markdown rendering"
|
||||
|
||||
# =============================================================================
|
||||
# PHASE 2: BASIC VALIDATORS (Structure and syntax)
|
||||
# =============================================================================
|
||||
@@ -168,7 +177,7 @@ repos:
|
||||
# --- Table Formatting Validation ---
|
||||
- id: check-table-formatting
|
||||
name: "Check table formatting (alignment, bolding, spacing)"
|
||||
entry: python tools/scripts/format_tables.py --check -d quarto/contents/
|
||||
entry: python tools/scripts/content/format_tables.py --check -d quarto/contents/
|
||||
language: python
|
||||
additional_dependencies: []
|
||||
pass_filenames: false
|
||||
@@ -178,7 +187,7 @@ repos:
|
||||
# --- Part Key Validation ---
|
||||
- id: validate-part-keys
|
||||
name: "Validate part keys in .qmd files"
|
||||
entry: python tools/scripts/validate_part_keys.py
|
||||
entry: python tools/scripts/utilities/validate_part_keys.py
|
||||
language: python
|
||||
additional_dependencies:
|
||||
- pyyaml
|
||||
@@ -194,7 +203,7 @@ repos:
|
||||
# --- Image Validation ---
|
||||
- id: validate-images
|
||||
name: "Validate image files"
|
||||
entry: python tools/scripts/utilities/manage_images.py
|
||||
entry: python tools/scripts/images/manage_images.py
|
||||
language: python
|
||||
additional_dependencies:
|
||||
- pillow
|
||||
@@ -204,7 +213,7 @@ repos:
|
||||
|
||||
- id: validate-external-images
|
||||
name: "Check for external images in Quarto files"
|
||||
entry: python tools/scripts/manage_external_images.py --validate quarto/contents/
|
||||
entry: python tools/scripts/images/manage_external_images.py --validate quarto/contents/
|
||||
language: python
|
||||
additional_dependencies: [requests]
|
||||
pass_filenames: false
|
||||
@@ -213,7 +222,7 @@ repos:
|
||||
|
||||
- id: validate-image-references
|
||||
name: "Check that all image references exist on disk"
|
||||
entry: python tools/scripts/validate_image_references.py -d quarto/contents/ --quiet
|
||||
entry: python tools/scripts/images/validate_image_references.py -d quarto/contents/ --quiet
|
||||
language: python
|
||||
additional_dependencies: []
|
||||
pass_filenames: false
|
||||
|
||||
Reference in New Issue
Block a user