Make formatting an error on presubmit

Currently the presubmit will emit a warning if the formatting fails
but this is easy to miss as the bot goes green. This CL changes
the presubmit to make formatting an error so the issue will be
caught and fixedup before landing.

Change-Id: Ifb83d2a7e524fd086e86b47f7518fea1e65f6d3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/109563
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Dan Sinclair <dsinclair@chromium.org>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index ecd0c62..8e03359 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -131,10 +131,17 @@
     results = []
     results.extend(
         input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api))
+
+    result_factory = output_api.PresubmitPromptWarning
+    if input_api.is_committing:
+        result_factory = output_api.PresubmitError
+
     results.extend(
-        input_api.canned_checks.CheckPatchFormatted(input_api,
-                                                    output_api,
-                                                    check_python=True))
+        input_api.canned_checks.CheckPatchFormatted(
+            input_api,
+            output_api,
+            check_python=True,
+            result_factory=result_factory))
     results.extend(
         input_api.canned_checks.CheckChangeHasDescription(
             input_api, output_api))