Add diag::Formatter::Style::print_newline_at_end

Automatically prints a newline at the end of the last diagnostic in a list. Defaults to true.

Disabled for many tests that assume no newline at end of string.

Change-Id: Id1c2f7771f03f22d926fafc2bebebcef056ac5e8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37260
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2021-01-11 21:09:22 +00:00
committed by Commit Bot service account
parent 4a0b9f77ef
commit d221738e20
10 changed files with 57 additions and 29 deletions

View File

@@ -41,7 +41,7 @@ class Validator {
/// @returns error messages from the validator
std::string error() {
diag::Formatter formatter{{false, false, false}};
diag::Formatter formatter{{false, false, false, false}};
return formatter.format(diags_);
}
/// @returns true if an error was encountered

View File

@@ -54,7 +54,7 @@ class ValidatorImpl {
/// @returns error messages from the validator
std::string error() {
diag::Formatter formatter{{false, false, false}};
diag::Formatter formatter{{false, false, false, false}};
return formatter.format(diags_);
}
/// @returns true if an error was encountered