[clang] [libclang/python] Add `Cursor.from_translation_unit` (PR #140496)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 18 23:25:44 PDT 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 HEAD~1...HEAD clang/bindings/python/clang/cindex.py clang/bindings/python/tests/cindex/test_cursor.py
``````````

</details>

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

``````````diff
--- tests/cindex/test_cursor.py	2025-05-19 06:20:55.000000 +0000
+++ tests/cindex/test_cursor.py	2025-05-19 06:25:20.022200 +0000
@@ -1067,6 +1067,6 @@
 
     def test_cursor_from_tu(self):
         tu = get_tu("int a = 0;")
         cursor = Cursor.from_translation_unit(tu)
         reference_cursor = tu.cursor
-        self.assertEqual(cursor, reference_cursor)        
+        self.assertEqual(cursor, reference_cursor)

``````````

</details>


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


More information about the cfe-commits mailing list