Skip to content

Explain malformed YAML front matter errors - #141

Open
rupayon123 wants to merge 1 commit into
eyeseast:mainfrom
rupayon123:contribution/clear-yaml-colon-error-20260925
Open

rupayon123 wants to merge 1 commit into
eyeseast:mainfrom
rupayon123:contribution/clear-yaml-colon-error-20260925

Conversation

@rupayon123

Copy link
Copy Markdown

Fixes #127.

Loading YAML front matter with an unquoted colon in a plain-text value, such as title: Assignment 1: Some Title, currently raises PyYAML's raw ScannerError. The revised error names YAML front matter, includes the parser's line and column, and offers a quoting hint for this specific malformed-value case. Other YAML errors also get frontmatter context without that hint; the original PyYAML exception remains chained as the cause.

The new regression test failed on current main and passes after the change. A valid quoted value remains unchanged.

Validation: pytest -q (59 passed), mypy frontmatter (4 source files clean), Python compilation, and git diff --check passed locally under Python 3.13. AI assistance was used for the change and tests.

Co-Authored-By: OpenAI GPT-6 (Codex) <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear error when frontmatter contains invalid colon

1 participant