[clang] [libclang] Allow using PrintingPolicy with types (PR #122386)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 9 14:59:31 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 9426fdd4cbd6812b69c218b865f184cb25342be4...a96fbe38f697f77c12c712f5573c2158072a8d2f clang/bindings/python/clang/cindex.py clang/bindings/python/tests/cindex/test_type.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- clang/cindex.py 2025-01-09 22:54:50.000000 +0000
+++ clang/cindex.py 2025-01-09 22:58:57.917693 +0000
@@ -2702,11 +2702,10 @@
return _CXString.from_result(conf.lib.clang_getTypeSpelling(self))
def pretty_printed(self, policy):
"""Pretty-prints this Type with the given PrintingPolicy"""
return _CXString.from_result(conf.lib.clang_getTypePrettyPrinted(self, policy))
-
def __eq__(self, other):
if type(other) != type(self):
return False
--- tests/cindex/test_type.py 2025-01-09 22:54:50.000000 +0000
+++ tests/cindex/test_type.py 2025-01-09 22:58:58.180775 +0000
@@ -5,11 +5,11 @@
CursorKind,
PrintingPolicy,
PrintingPolicyProperty,
RefQualifierKind,
TranslationUnit,
- TypeKind
+ TypeKind,
)
if "CLANG_LIBRARY_PATH" in os.environ:
Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"])
``````````
</details>
https://github.com/llvm/llvm-project/pull/122386
More information about the cfe-commits
mailing list