Skip to content

Commit 7f1f747

Browse files
authored
Format python (#475)
1 parent 34322de commit 7f1f747

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

checks.py

+6-11
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def remove_c_comments(code):
4747

4848

4949
def collect_function_args():
50-
""" Get a dict that maps function-names to another dict that maps arg-names to c-arg strings.
51-
"""
50+
"""Get a dict that maps function-names to another dict that maps arg-names to c-arg strings."""
5251

5352
funcs = {}
5453

@@ -75,8 +74,7 @@ def collect_function_args():
7574

7675

7776
def collect_structs():
78-
""" Get a dict that maps struct names to another dict that maps field-names to c-type string.
79-
"""
77+
"""Get a dict that maps struct names to another dict that maps field-names to c-type string."""
8078

8179
structs = {}
8280

@@ -117,8 +115,7 @@ def collect_structs():
117115

118116

119117
def check_rust_wrapper_args():
120-
""" Test that the wrappers use pointers where the c-header specifies pointers.
121-
"""
118+
"""Test that the wrappers use pointers where the c-header specifies pointers."""
122119

123120
funcs = collect_function_args()
124121

@@ -141,7 +138,7 @@ def check_rust_wrapper_args():
141138
print(f"In {funcname}:")
142139
i1 = text.find("(", i0)
143140
i2 = text.find(")", i1)
144-
args = " ".join(text[i1+1:i2].split())
141+
args = " ".join(text[i1 + 1 : i2].split())
145142
args = [arg.strip() for arg in args.split(",")]
146143
covered = set()
147144
for arg in args:
@@ -157,7 +154,7 @@ def check_rust_wrapper_args():
157154
print(message)
158155
if not ok:
159156
fails.append(message)
160-
#print(f" {status} {argname}: {typ}\n {' '*len(argname)}{c_arg}")
157+
# print(f" {status} {argname}: {typ}\n {' '*len(argname)}{c_arg}")
161158
missing = set(funcs[funcname]).difference(covered)
162159
if missing:
163160
message = f"{funcname} has missing args: {missing}"
@@ -168,8 +165,7 @@ def check_rust_wrapper_args():
168165

169166

170167
def check_overloaded_structs():
171-
""" Check that the overloaded structs in build.rs have fields that match the headers.
172-
"""
168+
"""Check that the overloaded structs in build.rs have fields that match the headers."""
173169

174170
structs = collect_structs()
175171

@@ -216,7 +212,6 @@ def check_overloaded_structs():
216212

217213

218214
def main():
219-
220215
fails = []
221216
fails += check_rust_wrapper_args()
222217
fails += check_overloaded_structs()

0 commit comments

Comments
 (0)