Configure the YAML mapper with FlockYamlFactory.builder() - #158
Merged
Merged
Conversation
Fourteen lines of DumperOptions and feature configuration become one. The builder carries exactly what this file was assembling by hand - block default flow style, width 480, pretty flow and canonical off, MINIMIZE_QUOTES on, no document start marker, a 16 MiB code point limit - because those defaults were measured from this file and hallux's equivalent before being chosen. The line break is the one thing the library does not assume, and the one call left. It defaults to LF, on the grounds that wanting CRLF is a property of a project whose files are already committed with CRLF rather than a property of YAML. Without .lineBreak(WIN) every line of all three model files would be rewritten on the first save, which is the churn the emitter exists to prevent. Both acceptance criteria hold, unchanged from #155: - the three model.yml files round-trip byte-identically through the builder-configured mapper - 451788, 40018 and 1043 bytes - checked in memory so nothing was written into the repo, and their on-disk hashes are unchanged after a full regeneration - regenerating all three libraries left 133 files differing in raw output, and one spotless:apply returned every one to the committed source That first result is worth more than it looks: it is yaml-flock#4's acceptance criterion tested against real production data rather than against the library's own catalogue fixture. mvn -Pstandard verify and mvn -Phistorical verify both pass. Closes #157 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fourteen lines of
DumperOptionsand feature configuration become one:The builder carries exactly what this file was assembling by hand — block default flow style, width 480, pretty flow and canonical off,
MINIMIZE_QUOTESon, no document start marker, a 16 MiB code point limit — which is unsurprising, since those defaults were measured from this file and hallux's equivalent before being chosen.The one call left is load-bearing
yaml-flock defaults to LF, deliberately: wanting CRLF is a property of a project whose files are already committed with CRLF rather than a property of YAML, so it is asked for rather than assumed. Without
.lineBreak(WIN)every line of all threemodel.ymlfiles would be rewritten on the first save — the churn the emitter exists to prevent.Acceptance, unchanged from #155
All three
model.ymlfiles round-trip byte-identically through the builder-configured mapper:Checked in memory via
writeLibraryModel, so nothing was written into the repo, and their on-disk SHA-256 hashes are unchanged after a full regeneration of all three libraries.Regeneration still lands on the committed sources. Regenerating left 133 files differing in raw output; one
spotless:applyreturned every one of them, leaving a clean tree. #127's property holds.That first result is worth more than it looks — it is yaml-flock#4's acceptance criterion exercised against real production data rather than against the library's own catalogue fixture. The fixture says the builder reproduces a hand-rolled configuration; a 451 KB model file written by the previous code and read back unchanged says it rather more convincingly.
Build
mvn -Pstandard verifyandmvn -Phistorical verifyboth pass, Spotless check included.Closes #157
🤖 Generated with Claude Code