[libcxx-commits] [libcxx] [libc++] Start tracking Github issues in status pages (PR #149833)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 21 08:14:15 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 HEAD~1...HEAD libcxx/utils/synchronize_csv_status_files.py
``````````

</details>

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

``````````diff
--- synchronize_csv_status_files.py	2025-07-21 15:07:42.000000 +0000
+++ synchronize_csv_status_files.py	2025-07-21 15:13:47.859824 +0000
@@ -170,17 +170,21 @@
     """
     Object from which this PaperInfo originated. This is used to track the CSV row or Github issue that
     was used to generate this PaperInfo and is useful for error reporting purposes.
     """
 
-    def __init__(self, paper_number: str, paper_name: str,
-                       status: PaperStatus,
-                       meeting: Optional[str] = None,
-                       first_released_version: Optional[str] = None,
-                       github_issue: Optional[str] = None,
-                       notes: Optional[str] = None,
-                       original: Optional[object] = None):
+    def __init__(
+        self,
+        paper_number: str,
+        paper_name: str,
+        status: PaperStatus,
+        meeting: Optional[str] = None,
+        first_released_version: Optional[str] = None,
+        github_issue: Optional[str] = None,
+        notes: Optional[str] = None,
+        original: Optional[object] = None,
+    ):
         self.paper_number = paper_number
         self.paper_name = paper_name
         self.status = status
         self.meeting = meeting
         self.first_released_version = first_released_version
@@ -192,13 +196,17 @@
         return (
             f'`{self.paper_number} <https://wg21.link/{self.paper_number}>`__',
             self.paper_name,
             self.meeting if self.meeting is not None else '',
             self.status.to_csv_entry(),
-            self.first_released_version if self.first_released_version is not None else '',
-            f'`#{self.github_issue} <https://github.com/llvm/llvm-project/issues/{self.github_issue}>`__' if self.github_issue is not None else '',
-            self.notes if self.notes is not None else '',
+            self.first_released_version
+            if self.first_released_version is not None
+            else "",
+            f"`#{self.github_issue} <https://github.com/llvm/llvm-project/issues/{self.github_issue}>`__"
+            if self.github_issue is not None
+            else "",
+            self.notes if self.notes is not None else "",
         )
 
     def __repr__(self) -> str:
         return repr(self.original) if self.original is not None else repr(self.for_printing())
 
@@ -211,11 +219,11 @@
         match = re.search(r"((P[0-9R]+)|(LWG[0-9]+)|(N[0-9]+))\s+", row[0])
         if match is None:
             raise RuntimeError(f"Can't parse paper/issue number out of row: {row}")
 
         # Match the issue number if present
-        github_issue = re.search(r'#([0-9]+)', row[5])
+        github_issue = re.search(r"#([0-9]+)", row[5])
         if github_issue:
             github_issue = github_issue.group(1)
 
         return PaperInfo(
             paper_number=match.group(1),
@@ -246,13 +254,13 @@
 
         return PaperInfo(
             paper_number=paper,
             paper_name=issue['title'].removeprefix(paper + ': '),
             status=PaperStatus.from_github_issue(issue),
-            meeting=issue.get('meeting Voted', None),
-            first_released_version=None, # TODO
-            github_issue=str(issue['content']['number']),
+            meeting=issue.get("meeting Voted", None),
+            first_released_version=None,  # TODO
+            github_issue=str(issue["content"]["number"]),
             notes=notes,
             original=issue,
         )
 
 def merge(paper: PaperInfo, gh: PaperInfo) -> PaperInfo:
@@ -268,12 +276,16 @@
     is not useful.
 
     In case we don't update the CSV row's status, we still take any updated notes coming
     from the Github issue and we add a link to the Github issue if it was previously missing.
     """
-    took_gh_in_full = False # Whether we updated the entire PaperInfo from the Github version
-    if paper.status == PaperStatus(PaperStatus.TODO) and gh.status == PaperStatus(PaperStatus.IN_PROGRESS):
+    took_gh_in_full = (
+        False  # Whether we updated the entire PaperInfo from the Github version
+    )
+    if paper.status == PaperStatus(PaperStatus.TODO) and gh.status == PaperStatus(
+        PaperStatus.IN_PROGRESS
+    ):
         result = copy.deepcopy(paper)
     elif paper.status < gh.status:
         result = copy.deepcopy(gh)
         took_gh_in_full = True
     elif paper.status == gh.status:
@@ -304,11 +316,13 @@
 
 def create_github_issue(paper: PaperInfo, labels: List[str]) -> None:
     """
     Create a new Github issue representing the given PaperInfo.
     """
-    assert paper.github_issue is None, "Trying to create a Github issue for a paper that is already tracked"
+    assert (
+        paper.github_issue is None
+    ), "Trying to create a Github issue for a paper that is already tracked"
 
     paper_name = paper.paper_name.replace('``', '`').replace('\\', '')
 
     create_cli = ['gh', 'issue', 'create', '--repo', 'llvm/llvm-project',
                     '--title', f'{paper.paper_number}: {paper_name}',
@@ -387,15 +401,19 @@
             continue
 
         # Validate the Github issue associated to the CSV row, if any
         if paper.github_issue is not None:
             if len(tracking) == 0:
-                print(f"Found row claiming to have a tracking issue, but failed to find a tracking issue on Github: {row}")
+                print(
+                    f"Found row claiming to have a tracking issue, but failed to find a tracking issue on Github: {row}"
+                )
                 results.append(row)
                 continue
             if len(tracking) == 1 and paper.github_issue != tracking[0].github_issue:
-                print(f"Found row with incorrect tracking issue: {row}\ntracked by: {tracking[0]}")
+                print(
+                    f"Found row with incorrect tracking issue: {row}\ntracked by: {tracking[0]}"
+                )
                 results.append(row)
                 continue
 
         # If there is no tracking issue for that row and we are creating new issues, do that.
         # Otherwise just log that we're missing an issue.

``````````

</details>


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


More information about the libcxx-commits mailing list