Add GuidFormats option to ScrubInlineGuids
Merged
SI
4mo ago+166+166+012345678901234567890123456789-14-14-01234567890123456789
Fixes #1822
Problem
ScrubInlineGuids matches both D format (00000000-0000-0000-0000-000000000000) and N format (00000000000000000000000000000000) guids. Since any 32 character hex sequence is a valid N format guid, hex content of that exact length (an MD5 hash for example) is also scrubbed. There was no way to opt out of N matching while keeping D.
Change
Add a GuidFormats flags enum and new ScrubInlineGuids overloads that accept it:
// Only scrub dashed "D" format guids; 32 char hex hashes are left untouched
.ScrubInlineGuids(GuidFormats.Dashed)
GuidFormats=Dashed(theDformat, which also coversB/P) |Undashed(theNformat) |All.- The existing parameterless / extension-only signatures are left untouched; the format selection is exposed as added overloads rather than an optional parameter, so this is not a binary breaking change (an optional parameter would change the existing method signatures and break callers compiled against them with
MissingMethodException). - Applied consistently across all entry points: instance / global × plain / extension-mapped, plus the fluent
SettingsTaskwrappers. A sharedGuidMatcher.ForFormatshelper preserves the existingD-then-Nscrubber order, and the original methods now delegate toGuidFormats.All.
Tests & docs
- Added tests proving
GuidFormats.Dashedleaves anNformat hash untouched, andGuidFormats.Undashedleaves aDformat guid untouched. - Documented the new option in
docs/mdsource/guids.source.mdand regenerateddocs/guids.md.