[clang] [libclang/python] Add python bindings for PrintingPolicy (PR #120494)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 18 15:35:03 PST 2024


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 07e053fb95e131244dafab04aae84650de383664...8f2e784333ed7cdd746dd408b18c2f12297378fe 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
--- clang/cindex.py	2024-12-18 23:26:35.000000 +0000
+++ clang/cindex.py	2024-12-18 23:34:37.721226 +0000
@@ -1774,11 +1774,13 @@
         """
         Pretty print declarations.
         Parameters:
         policy -- The policy to control the entities being printed.
         """
-        return _CXString.from_result(conf.lib.clang_getCursorPrettyPrinted(self, policy))
+        return _CXString.from_result(
+            conf.lib.clang_getCursorPrettyPrinted(self, policy)
+        )
 
     @property
     def displayname(self):
         """
         Return the display name for the entity referenced by this cursor.
@@ -3695,10 +3697,11 @@
 
 class PrintingPolicyProperty(BaseEnumeration):
     """
     A PrintingPolicyProperty identifies a property of a PrintingPolicy.
     """
+
     Indentation = 0
     SuppressSpecifiers = 1
     SuppressTagKeyword = 2
     IncludeTagDefinition = 3
     SuppressScope = 4
@@ -3721,10 +3724,11 @@
     IncludeNewlines = 21
     MSVCFormatting = 22
     ConstantsAsWritten = 23
     SuppressImplicitBase = 24
     FullyQualifiedName = 25
+
 
 class PrintingPolicy(ClangObject):
     """
     The PrintingPolicy is a wrapper class around clang::PrintingPolicy
 

``````````

</details>


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


More information about the cfe-commits mailing list