[libcxx-commits] [libcxx] [libc++] Add missing headers to the modulemap (PR #71127)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 15 15:16:47 PST 2023


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 322799aa5010812550eec6b300bce185b6718109..1e53ce76361f99f60d1144ad202254cc0f2b922d libcxx/test/libcxx/headers_in_modulemap.sh.py
``````````

</details>

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

``````````diff
--- headers_in_modulemap.sh.py	2023-11-15 23:14:15.000000 +0000
+++ headers_in_modulemap.sh.py	2023-11-15 23:16:40.772857 +0000
@@ -6,46 +6,48 @@
 headers = list(pathlib.Path(sys.argv[1]).rglob("*"))
 modulemap = open(f"{sys.argv[1]}/module.modulemap").read()
 
 isHeaderMissing = False
 
+
 def ignore_header(header):
-  # TODO: Should `__config_site` be in the modulemap?
-  if header == "__config_site":
-    return True
+    # TODO: Should `__config_site` be in the modulemap?
+    if header == "__config_site":
+        return True
 
-  # exclude libc++abi files
-  if header in ["cxxabi.h", "__cxxabi_config.h"]:
-    return True
+    # exclude libc++abi files
+    if header in ["cxxabi.h", "__cxxabi_config.h"]:
+        return True
 
-  # exclude non-header files
-  if header in ["libcxx.imp", "module.modulemap"]:
-    return True
+    # exclude non-header files
+    if header in ["libcxx.imp", "module.modulemap"]:
+        return True
 
-  # exclude headers in __support/ - these aren't supposed to work everywhere,
-  # so they shouldn't be included in general
-  if header.startswith("__support/"):
-    return True
+    # exclude headers in __support/ - these aren't supposed to work everywhere,
+    # so they shouldn't be included in general
+    if header.startswith("__support/"):
+        return True
 
-  # exclude ext/ headers - these are non-standard extensions and are barely
-  # maintained. People should migrate away from these and we don't need to
-  # burden ourself with maintaining them in any way.
-  if header.startswith("ext/"):
-    return True
+    # exclude ext/ headers - these are non-standard extensions and are barely
+    # maintained. People should migrate away from these and we don't need to
+    # burden ourself with maintaining them in any way.
+    if header.startswith("ext/"):
+        return True
 
-  return False
+    return False
+
 
 for header in headers:
-  if not header.is_file():
-    continue
+    if not header.is_file():
+        continue
 
-  header = header.relative_to(pathlib.Path(sys.argv[1])).as_posix()
+    header = header.relative_to(pathlib.Path(sys.argv[1])).as_posix()
 
-  if ignore_header(str(header)):
-    continue
+    if ignore_header(str(header)):
+        continue
 
-  if not str(header) in modulemap:
-    print(f"Header {header} seems to be missing from the modulemap!")
-    isHeaderMissing = True
+    if not str(header) in modulemap:
+        print(f"Header {header} seems to be missing from the modulemap!")
+        isHeaderMissing = True
 
-if (isHeaderMissing):
-  exit(1)
+if isHeaderMissing:
+    exit(1)

``````````

</details>


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


More information about the libcxx-commits mailing list