[clang] [analyzer] Introduce per-entry-point statistics (PR #131175)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 13 10:56:06 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 b3b00707821276deef812d8cccb228dd42c044d7...6b6d80d42d40d5917622cbc2bc0f2a454c34eca3 clang/test/Analysis/csv2json.py clang/test/lit.cfg.py
``````````

</details>

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

``````````diff
--- Analysis/csv2json.py	2025-03-13 17:42:39.000000 +0000
+++ Analysis/csv2json.py	2025-03-13 17:55:36.667231 +0000
@@ -29,10 +29,11 @@
 
 import csv
 import sys
 import json
 
+
 def csv_to_json_dict(csv_filepath):
     """
     Args:
         csv_filepath: The path to the input CSV file.
 
@@ -40,21 +41,23 @@
         FileNotFoundError: If the CSV file does not exist.
         csv.Error: If there is an error parsing the CSV file.
         Exception: For any other unexpected errors.
     """
     try:
-        with open(csv_filepath, 'r', encoding='utf-8') as csvfile:
+        with open(csv_filepath, "r", encoding="utf-8") as csvfile:
             reader = csv.reader(csvfile)
 
             # Read the header row (column names)
             try:
                 header = next(reader)
             except StopIteration:  # Handle empty CSV file
                 json.dumps({}, indent=2)  # write an empty dict
                 return
 
-            if not header: #handle a csv file that contains no rows, not even a header row.
+            if (
+                not header
+            ):  # handle a csv file that contains no rows, not even a header row.
                 json.dumps({}, indent=2)
                 return
 
             other_column_names = [name.strip() for name in header[1:]]
 
@@ -67,11 +70,13 @@
 
                 key = row[0]
                 value_map = {}
 
                 for i, col_name in enumerate(other_column_names):
-                    value_map[col_name] = row[i + 1].strip()  # +1 to skip the first column
+                    value_map[col_name] = row[
+                        i + 1
+                    ].strip()  # +1 to skip the first column
 
                 data_dict[key] = value_map
 
         return json.dumps(data_dict, indent=2)
 
@@ -92,7 +97,8 @@
     except (FileNotFoundError, csv.Error, Exception) as e:
         print(str(e))
     except:
         print("An error occured")
 
-if __name__ == '__main__':
+
+if __name__ == "__main__":
     main()
--- lit.cfg.py	2025-03-13 17:42:39.000000 +0000
+++ lit.cfg.py	2025-03-13 17:55:36.766630 +0000
@@ -184,13 +184,11 @@
             "%check_analyzer_fixit",
             '"%s" %s' % (config.python_executable, check_analyzer_fixit_path),
         )
     )
 
-    csv2json_path = os.path.join(
-        config.test_source_root, "Analysis", "csv2json.py"
-    )
+    csv2json_path = os.path.join(config.test_source_root, "Analysis", "csv2json.py")
     config.substitutions.append(
         (
             "%csv2json",
             '"%s" %s' % (config.python_executable, csv2json_path),
         )

``````````

</details>


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


More information about the cfe-commits mailing list