From a9ef0645b3036aa73bb4564ffa1c00392dd8a166 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 12 Jun 2026 22:23:03 +0200 Subject: [PATCH 1/2] Fix unused comment flag --- capitalize_comments.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/capitalize_comments.py b/capitalize_comments.py index 99b6c29..ec0e5d0 100755 --- a/capitalize_comments.py +++ b/capitalize_comments.py @@ -16,7 +16,9 @@ def capitalize_comment_line(line: str, prev_was_comment: bool) -> str: if prev_was_comment: return line - return re.sub(r"^(\s*)# (\w)", lambda m: f"{m.group(1)}# {m.group(2).upper()}", line) + return re.sub( + r"^(\s*)# (\w)", lambda m: f"{m.group(1)}# {m.group(2).upper()}", line + ) def process_file(file_path: Path): @@ -27,7 +29,7 @@ def process_file(file_path: Path): prev_was_comment = False processed_lines = [] for line in lines: - if is_comment := line.strip().startswith("#"): + if line.strip().startswith("#"): processed_line = capitalize_comment_line(line, prev_was_comment) processed_lines.append(processed_line) prev_was_comment = True From efdc5d36ab10cf738733401094ecfc82e24a2f62 Mon Sep 17 00:00:00 2001 From: UltralyticsAssistant Date: Fri, 12 Jun 2026 20:24:19 +0000 Subject: [PATCH 2/2] Auto-format by https://ultralytics.com/actions --- capitalize_comments.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/capitalize_comments.py b/capitalize_comments.py index ec0e5d0..4802b7b 100755 --- a/capitalize_comments.py +++ b/capitalize_comments.py @@ -16,9 +16,7 @@ def capitalize_comment_line(line: str, prev_was_comment: bool) -> str: if prev_was_comment: return line - return re.sub( - r"^(\s*)# (\w)", lambda m: f"{m.group(1)}# {m.group(2).upper()}", line - ) + return re.sub(r"^(\s*)# (\w)", lambda m: f"{m.group(1)}# {m.group(2).upper()}", line) def process_file(file_path: Path):