Make DisplayOptions JSON-deserializable#153
Conversation
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot please review these comments.
…sync, internal converters Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot Please checkout these comments.
…self-sufficient converters; convert tests Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot Please check out these comments.
…or, camelCase, options-aware enum (de)serialization Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot Please check out this comment.
…yling JSON converters Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot Please address this comment.
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Fix build Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot there are some build breaks I would you take a look at
https://github.com/boxofyellow/ConsoleMarkdownRenderer/actions/runs/26260426954/job/77292440234
But there is also
https://github.com/boxofyellow/ConsoleMarkdownRenderer/actions/runs/26260426954/job/77292440220
For net8.0 only failure I think we need to make those cases conditionally compiled.
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Fixed in 29831c6 — corrected the |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #153 +/- ##
==========================================
+ Coverage 95.92% 96.09% +0.16%
==========================================
Files 31 34 +3
Lines 1743 1946 +203
Branches 182 214 +32
==========================================
+ Hits 1672 1870 +198
Misses 46 46
- Partials 25 30 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
boxofyellow
left a comment
There was a problem hiding this comment.
@copilot I listed all the lines that code coverage workflow says were not covered.
Before doing any of them please double check that the workflow is set up correctly
https://github.com/boxofyellow/ConsoleMarkdownRenderer/blob/main/.github/workflows/code-coverage.yml
Walked through
One thing worth calling out about your So: no workflow fix needed. Ready to go fill in the missing tests — want me to proceed on all of the line-level comments? |
Co-authored-by: boxofyellow <54955040+boxofyellow@users.noreply.github.com>
Added coverage in Notes:
|
Code-coverage reports flagged uncovered branches across the new STJ converters and
DisplayOptions(de)serialization helpers introduced for JSON round-tripping. This PR closes those gaps.JsonConverterCoverageTests.cs(new, 12 tests)HeaderStyleJsonConverter: missing / null / unknown$typediscriminator (read), unsupportedIHeaderStyleimpl (write).TextColorJsonConverter: RGB-channel round-trip and missing-channel fallback to zero.DisplayOptions.DeserializeAsync(Stream): round-trip with and without caller-suppliedJsonSerializerOptions; also exercises theHeader is FigletTextStylearm inEnsureHeaderFontsLoadedAsync.JsonWriteHelpers.ShouldIgnore:Alwaysarm and out-of-rangedefaultthrow (unreachable via the publicJsonSerializerOptions.DefaultIgnoreConditionsetter, which rejectsAlwaysat runtime).Dead-code removal in converter
Readmethodsif (reader.TokenType == JsonTokenType.Null) return null;from bothHeaderStyleJsonConverterandTextColorJsonConverter.System.Text.Jsonshort-circuits null tokens for reference-type converters that don't overrideHandleNull, so those branches were never invoked. JSONnullforHeader/Foregroundstill deserializes tonullvia the framework path (asserted by tests).JsonWriteHelpers.ShouldIgnore<T>visibilityprivatetointernalso tests can invoke it directly (the test project already hasInternalsVisibleTo).Result: 0 uncovered lines remain in
DisplayOptions.cs,HeaderStyleJsonConverter.cs,TextColorJsonConverter.cs, andJsonWriteHelpers.cs.