[repo-assist] Fix front-matter parsing truncating values containing colons - #1275
Draft
github-actions[bot] wants to merge 1 commit into
Draft
[repo-assist] Fix front-matter parsing truncating values containing colons#1275github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary (Task 5 — Coding Improvement)
FrontMatterFile.ParseFromLinesinsrc/FSharp.Formatting.Common/Templating.fsparses YAML-like front matter (category,categoryindex,index) by splitting each line on:and keeping only the first two segments. Any additional:characters in a value were silently discarded — e.g. atitle:field containing a colon (title: F#: An Introduction) would be captured as just"F#".While
titleisn't currently consumed by this parser, the same bug would silently corrupt any future or custom front-matter field containing a colon, and this exact fix was previously implemented (and reviewed positively) in a since-closed PR (#1105) whose other, unrelated changes (nested navigation categories) ran into merge conflicts. This PR extracts just the safe, isolated colon-parsing fix plus regression tests, so it doesn't get lost.Change
FrontMatterFile.ParseFromLines: instead offirst :: second :: _ -> Some(first, second), now joins all parts after the first:withString.Join(":", rest), preserving the full value.tests/FSharp.Literate.Tests/DocContentTests.fs:Noneis still returned when required fields (category/categoryindex/index) are missing.RELEASE_NOTES.mdentry under[Unreleased] / Fixed.Test Status
dotnet build FSharp.Formatting.sln --configuration Release— Build succeeded, 0 warnings, 0 errors.dotnet test tests/FSharp.Literate.Tests/FSharp.Literate.Tests.fsproj --configuration Release --no-build— all 145 tests passed (2 new).dotnet fantomas.Trade-offs
Add this agentic workflow to your repo
To install this agentic workflow, run