Skip to content

Commit 1d0c8f6

Browse files
committed
Fix indentation on the output.
1 parent 681962d commit 1d0c8f6

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Tools/check-c-api-docs/main.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
if line.startswith("#"):
2323
IGNORED.pop(index)
2424

25-
MISTAKE = """\
25+
MISTAKE = """
2626
If this is a mistake and this script should not be failing, create an
2727
issue and tag Peter (@ZeroIntensity) on it.\
2828
"""
@@ -35,8 +35,9 @@ def found_undocumented(singular: bool):
3535
them = "it" if singular else "them"
3636
were = "was" if singular else "were"
3737

38-
return textwrap.dedent(
39-
f"""\
38+
return (
39+
textwrap.dedent(
40+
f"""
4041
Found {some} undocumented C API{s}!
4142
4243
Python requires documentation on all public C API symbols, macros, and types.
@@ -46,9 +47,9 @@ def found_undocumented(singular: bool):
4647
4748
In exceptional cases, certain APIs can be ignored by adding them to
4849
Tools/c-api-docs-check/ignored_c_api.txt
49-
50-
{MISTAKE}\
5150
"""
51+
)
52+
+ MISTAKE
5253
)
5354

5455

@@ -59,14 +60,15 @@ def found_ignored_documented(singular: bool) -> str:
5960
were = "was" if singular else "were"
6061
they = "it" if singular else "they"
6162

62-
return textwrap.dedent(
63-
f"""\
63+
return (
64+
textwrap.dedent(
65+
f"""
6466
Found {some} C API{s} listed in Tools/c-api-docs-check/ignored_c_api.txt, but
6567
{they} {were} found in the documentation. To fix this, remove {them} from
6668
ignored_c_api.txt.
67-
68-
{MISTAKE}\
6969
"""
70+
)
71+
+ MISTAKE
7072
)
7173

7274

@@ -181,7 +183,6 @@ def main() -> None:
181183
print(f"-- {len(name_list)} {what} C API{s} --")
182184
for name in name_list:
183185
print(f" - {name}")
184-
print()
185186
print(message)
186187
fail = True
187188

0 commit comments

Comments
 (0)