Liquid syntax check test and hook | Generated by AI
Done. Here’s the summary:
What was added:
-
tests/workflow/test_liquid_syntax.py— scans_posts/andnotes/for bare{% %}outside of...blocks. Reports file path, line number, and content for each violation. -
.pre-commit-config.yaml— newliquid-syntax-checkhook that runs the test on every commit (always_run: true).
How it works:
- Finds all
{% %}patterns (empty Liquid tags that cause fatalLiquid::SyntaxError) - Checks each occurrence is inside either:
- A file-level
...wrapper - An inline
{% %}escape
- A file-level
- Reports violations with clear fix instructions
Also fixed: notes/2026-06-14-liquid-tag-build-fix-en.md had 3 bare {% %} — escaped with inline raw/endraw.
Note: bandit has a pre-existing false positive (B608 on scripts/recommendation/api_utils.py) unrelated to this change. You may want to add B608 to the skip list.