[libcxx-commits] [libcxx] [libc++] Fix the declarative generation of FTMs (PR #108843)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 16 08:27:39 PDT 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 165f0e80f6b811ab0c82b52e39cb5fb4010850b7...2cefd1eaf52cdd98647f4d17bb06d467b62af2c1 libcxx/test/libcxx/feature_test_macro/ftm_metadata.sh.py libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py libcxx/test/libcxx/feature_test_macro/standard_ftms.sh.py libcxx/test/libcxx/feature_test_macro/version_header.sh.py libcxx/test/libcxx/feature_test_macro/version_header_implementation.sh.py libcxx/utils/generate_feature_test_macro_components.py
``````````

</details>

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

``````````diff
--- test/libcxx/feature_test_macro/version_header_implementation.sh.py	2024-09-16 15:17:32.000000 +0000
+++ test/libcxx/feature_test_macro/version_header_implementation.sh.py	2024-09-16 15:27:08.315569 +0000
@@ -16,14 +16,15 @@
 del sys.argv[1:3]
 
 sys.path.append(UTILS)
 from generate_feature_test_macro_components import FeatureTestMacros
 
+
 class Test(unittest.TestCase):
     def setUp(self):
         self.ftm = FeatureTestMacros(TEST_DATA)
-        self.maxDiff = None # This causes the diff to be printed when the test fails
+        self.maxDiff = None  # This causes the diff to be printed when the test fails
 
     def test_implementation(self):
         expected = {
             "17": [
                 {
@@ -139,7 +140,8 @@
             ],
         }
 
         self.assertEqual(self.ftm.version_header_implementation, expected)
 
-if __name__ == '__main__':
+
+if __name__ == "__main__":
     unittest.main()
--- utils/generate_feature_test_macro_components.py	2024-09-16 15:17:32.000000 +0000
+++ utils/generate_feature_test_macro_components.py	2024-09-16 15:27:08.934662 +0000
@@ -2197,12 +2197,18 @@
                     continue
                 last_value = value
 
                 entry = dict()
                 entry["value"] = value
-                entry["implemented"] = self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std]
-                entry["need_undef"] = last_entry is not None and last_entry["implemented"] and entry["implemented"]
+                entry["implemented"] = (
+                    self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std]
+                )
+                entry["need_undef"] = (
+                    last_entry is not None
+                    and last_entry["implemented"]
+                    and entry["implemented"]
+                )
                 entry["condition"] = self.ftm_metadata[ftm]["libcxx_guard"]
 
                 last_entry = entry
                 result[get_std_number(std)].append(dict({ftm: entry}))
 

``````````

</details>


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


More information about the libcxx-commits mailing list