Commit Graph

3 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
28fbd01560 fix(precommit): replace Python 3.10+ union syntax with Optional
Replace 'str | None' with 'Optional[str]' in validate_citations.py
for compatibility with Python 3.9 and earlier versions used in
pre-commit environments.
2025-11-02 11:15:33 -05:00
Vijay Janapa Reddi
914e4bfb4d fix(citations): add missing bibliography entries and improve validation
Add missing citations to chapter bib files:
- carlini2021extracting to privacy_security.bib
- koomey2011web to frontiers.bib
- quinonero2009dataset to robust_ai.bib

Enhance citation validation script:
- Strip trailing punctuation (.,;:) from citation keys
- Filter out DOI-style citations (e.g., @10.1109/...)
- Prevent false positives from citations like [@key.]

These changes fix all reported citation validation failures while
improving the validation script to handle edge cases better.
2025-10-09 15:01:07 -04:00
Vijay Janapa Reddi
4fe88bf456 feat(pre-commit): add citation validation hook
Add new pre-commit hook to validate that all @key citations in .qmd
files have corresponding entries in their .bib files. This catches
missing bibliography entries before they cause Quarto build failures.

Features:
- Validates citations against bibliography files
- Filters out cross-reference labels (fig-, tbl-, sec-, etc.)
- Provides clear error messages with missing citation keys
- Only checks files being committed (not entire codebase)
- Runs in quiet mode to reduce noise

New script: tools/scripts/content/validate_citations.py
Updated: .pre-commit-config.yaml with validate-citations hook
2025-10-09 14:47:35 -04:00