[Mlir-commits] [mlir] [mlir] Better Python diagnostics (PR #128581)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Feb 24 13:29:23 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r f3a29906aa07d08bbde7ec02b93d02e25d805110...87cbc6c2624555b145a934bf1d33438af4e8ecc4 mlir/test/python/ir/diagnostic_handler.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- diagnostic_handler.py	2025-02-24 21:22:21.000000 +0000
+++ diagnostic_handler.py	2025-02-24 21:28:51.309612 +0000
@@ -1,10 +1,12 @@
 # RUN: %PYTHON %s | FileCheck %s
 
 import gc
 from mlir.ir import *
-from mlir._mlir_libs._mlirPythonTestNanobind import test_diagnostics_with_errors_and_notes
+from mlir._mlir_libs._mlirPythonTestNanobind import (
+    test_diagnostics_with_errors_and_notes,
+)
 
 
 def run(f):
     print("\nTEST:", f.__name__)
     f()
@@ -222,10 +224,11 @@
     loc = Location.unknown(ctx)
     # CHECK: CALLBACK2: foobar
     # CHECK: CALLBACK1: foobar
     loc.emit_error("foobar")
 
+
 # CHECK-LABEL: TEST: testBuiltInDiagnosticsHandler
 @run
 def testBuiltInDiagnosticsHandler():
     ctx = Context()
 
@@ -233,6 +236,5 @@
         test_diagnostics_with_errors_and_notes(ctx)
     except ValueError as e:
         # CHECK: created error
         # CHECK: MLIRPythonCAPI
         print(e)
-

``````````

</details>


https://github.com/llvm/llvm-project/pull/128581


More information about the Mlir-commits mailing list