Conversation
WalkthroughThis PR extends the front-matter plugin with configurable YAML normalization capabilities. It introduces a new Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@mdformat_front_matters/_formatters.py`:
- Around line 58-83: The representer registrations for
_NullNormalizingRepresenter (the add_representer calls for type(None),
SingleQuotedScalarString, and DoubleQuotedScalarString which reference
_represent_as_plain_str) should be co-located with the class: move those
add_representer calls into the class body immediately after its docstring (or
implement __init_subclass__ on _NullNormalizingRepresenter to perform the
registrations at subclass creation), so the registration and the explanatory
docstring live together; ensure the lambda for null and the
_represent_as_plain_str reference remain unchanged and still target the same
tags/types.
In `@tests/format/fixtures/normalization.md`:
- Around line 39-52: The test title "YAML null unchanged under none" is
misleading because input `key: ~` is serialized as `key:` (representation
changed), so either rename the test to reflect that the representation is
normalized (e.g., "YAML null representation normalized (~ -> implicit) under
none") or update the code path that serializes YAML in "none" mode to preserve
`~` by adding a custom null representer in the ruamel.yaml serialization
routine; locate the test string "YAML null unchanged under none" in
normalization.md to change the title, or locate the YAML serializer/normalizer
function that handles "none" mode (the routine that invokes ruamel.yaml dumping)
and add/configure a null representer so `~` is preserved.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 87b5e923-ebf5-46b2-bff9-c5e094d9dc2f
📒 Files selected for processing (7)
AGENTS.mdREADME.mdmdformat_front_matters/_formatters.pymdformat_front_matters/plugin.pytests/format/fixtures/normalization.mdtests/format/fixtures/quote_preservation.mdtests/format/test_format.py
No description provided.