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 origin/main...HEAD
clang-tools-extra/clang-tidy/tool/clang-tidy-alphabetical-order-check.py
clang-tools-extra/test/lit.cfg.py
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- clang-tidy/tool/clang-tidy-alphabetical-order-check.py 2025-11-02
14:56:53.000000 +0000
+++ clang-tidy/tool/clang-tidy-alphabetical-order-check.py 2025-11-02
15:08:27.965429 +0000
@@ -78,13 +78,11 @@
out.extend(lines[i:])
return "".join(out)
-def run_checks_list(
- inp: Optional[str], out_path: Optional[str], fix: bool
-) -> int:
+def run_checks_list(inp: Optional[str], out_path: Optional[str], fix: bool) ->
int:
if not inp:
inp = os.path.normpath(
os.path.join(
script_dir(),
"..",
@@ -114,15 +112,11 @@
def find_heading(lines: Sequence[str], title: str) -> Optional[int]:
for i in range(len(lines) - 1):
if lines[i].rstrip("\n") == title:
underline = lines[i + 1].rstrip("\n")
- if (
- underline
- and set(underline) == {"^"}
- and len(underline) >= len(title)
- ):
+ if underline and set(underline) == {"^"} and len(underline) >=
len(title):
return i
return None
def extract_label(text: str) -> str:
@@ -204,22 +198,18 @@
next_title = sections[idx + 1][0]
h_end = find_heading(out, next_title)
if h_end is None:
h_end = sec_start
while h_end + 1 < len(out):
- if out[h_end].strip() and set(
- out[h_end + 1].rstrip("\n")
- ) == {"^"}:
+ if out[h_end].strip() and set(out[h_end + 1].rstrip("\n"))
== {"^"}:
break
h_end += 1
sec_end = h_end
else:
h_end = sec_start
while h_end + 1 < len(out):
- if out[h_end].strip() and set(out[h_end + 1].rstrip("\n")) == {
- "^"
- }:
+ if out[h_end].strip() and set(out[h_end + 1].rstrip("\n")) ==
{"^"}:
break
h_end += 1
sec_end = h_end
prefix, blocks, suffix = collect_bullet_blocks(out, sec_start, sec_end)
@@ -227,25 +217,22 @@
new_section: List[str] = []
new_section.extend(prefix)
for i_b, b in enumerate(sorted_blocks):
if i_b > 0 and (
- not new_section
- or (new_section and new_section[-1].strip() != "")
+ not new_section or (new_section and new_section[-1].strip() !=
"")
):
new_section.append("\n")
new_section.extend(b)
new_section.extend(suffix)
out = out[:sec_start] + new_section + out[sec_end:]
return "".join(out)
-def run_release_notes(
- inp: Optional[str], out_path: Optional[str], fix: bool
-) -> int:
+def run_release_notes(inp: Optional[str], out_path: Optional[str], fix: bool)
-> int:
if not inp:
inp = os.path.normpath(
os.path.join(script_dir(), "..", "..", "docs", "ReleaseNotes.rst")
)
lines = read_text(inp)
@@ -276,13 +263,11 @@
ap_checks.add_argument("-o", "--output", dest="out", default=None)
ap_checks.add_argument(
"--fix", action="store_true", help="rewrite the input file in place"
)
- ap_rn = sub.add_parser(
- "release-notes", help="normalize ReleaseNotes.rst sections"
- )
+ ap_rn = sub.add_parser("release-notes", help="normalize ReleaseNotes.rst
sections")
ap_rn.add_argument("-i", "--input", dest="inp", default=None)
ap_rn.add_argument("-o", "--output", dest="out", default=None)
ap_rn.add_argument(
"--fix", action="store_true", help="rewrite the input file in place"
)
``````````
</details>
https://github.com/llvm/llvm-project/pull/166072
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits