Repository navigation
馃悰 Keep month field enclosing when the value is not transformed - #605
Merged
Merged
Conversation
MiWeiss
force-pushed
the
fix/month-enclosing
branch
3 times, most recently
from
September 2, 2026 20:00
fedcb90 to
ebcf150
Compare
The month middlewares assigned `Field.value` unconditionally, and that setter resets `Field.enclosing` to None. For values the middleware cannot resolve (bibtex string references like `month = foo`, or concatenations like `mymonth # "foo"`), this discarded the `no-enclosing` demand, so `AddEnclosingMiddleware` wrapped them in braces and turned a reference into a literal. The value is now assigned only when it actually changed (comparing type as well, so e.g. "1" -> 1 still counts as a change). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
MiWeiss
force-pushed
the
fix/month-enclosing
branch
from
September 2, 2026 20:03
ebcf150 to
66b450e
Compare
Collaborator
Author
|
lgtm |
MiWeiss
force-pushed
the
fix/month-enclosing
branch
from
September 2, 2026 20:38
199f18c to
4d107b9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_MonthInterpolator.transform_entryassignsmonth.valueeven when the month could not be resolved. TheField.valuesetter resetsenclosing, so theno-enclosingdemand on a reference is lost andAddEnclosingMiddlewarebraces it into a literal.Fix: assign only when the value actually changed, comparing type too, since
"1"to1is a real transformation._demanded_enclosingand the metadata line stay outside the guard, becauseMonthAbbreviationMiddlewaredemandsno-enclosingfor an already-correctjan.model.pyuntouched; the setter's reset is documented behavior.Tests: 5 cases across all three month middlewares, 3 fail before. Suite 2581 passed, from 2576.
馃 Generated with Claude Code