Add opt in newline tolerance settings

Merged
SI
4mo ago
+2750-391

Restores, as opt in, the two tolerances removed in 7253acb.

VerifierSettings.FixNewlinesOnRead normalizes \r\n and \r to \n when reading verified files, instead of rejecting a verified file that contains a carriage return.

VerifierSettings.IgnoreTrailingNewline treats a verified file that ends in a single \n, where that newline accounts for the entire difference in length, as equal to the received content.

Both are global and guarded by ThrowIfVerifyHasBeenRun, so a module initializer is the only place to set them. That makes either a repo level fix requiring no per developer setup, which is what #1824 asks for.

Neither is a replacement for the .gitattributes and EditorConfig settings, and enabling them has side effects: line endings on disk diverge between accept workflows, the misconfiguration is no longer surfaced anywhere, diff output during a real mismatch is noisier, reported content no longer matches the bytes on disk, normalizing allocates, and IgnoreTrailingNewline can mask output that stops emitting a trailing newline. All documented in the new docs/newline-tolerance.md, linked from the exception message, the xml docs, and the doc index.

Closes #1824