[Mlir-commits] [mlir] [mlir] Add C and Python interface for file range (PR #123276)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jan 16 19:04:41 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 c24ce324d56328e4b91c8797ea4935545084303e...5dd46b1aeb9c50c8811d65e90001da217cdfb1c7 mlir/test/python/ir/location.py
``````````

</details>

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

``````````diff
--- location.py	2025-01-17 02:58:55.000000 +0000
+++ location.py	2025-01-17 03:04:12.011687 +0000
@@ -43,23 +43,23 @@
 
 run(testLocationAttr)
 
 # CHECK-LABEL: TEST: testFileLineCol
 def testFileLineCol():
-  with Context() as ctx:
-    loc = Location.file("foo.txt", 123, 56)
-    range = Location.file("foo.txt", 123, 56, 123, 100)
-  ctx = None
-  gc.collect()
-  # CHECK: file str: loc("foo.txt":123:56)
-  print("file str:", str(loc))
-  # CHECK: file repr: loc("foo.txt":123:56)
-  print("file repr:", repr(loc))
-  # CHECK: file range str: loc("foo.txt":123:56 to :100)
-  print("file range str:", str(range))
-  # CHECK: file range repr: loc("foo.txt":123:56 to :100)
-  print("file range repr:", repr(range))
+    with Context() as ctx:
+        loc = Location.file("foo.txt", 123, 56)
+        range = Location.file("foo.txt", 123, 56, 123, 100)
+    ctx = None
+    gc.collect()
+    # CHECK: file str: loc("foo.txt":123:56)
+    print("file str:", str(loc))
+    # CHECK: file repr: loc("foo.txt":123:56)
+    print("file repr:", repr(loc))
+    # CHECK: file range str: loc("foo.txt":123:56 to :100)
+    print("file range str:", str(range))
+    # CHECK: file range repr: loc("foo.txt":123:56 to :100)
+    print("file range repr:", repr(range))
 
 
 run(testFileLineCol)
 
 

``````````

</details>


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


More information about the Mlir-commits mailing list