Skip to content

Commit 616a84f

Browse files
committed
pinvalidate.py script: remove spaces
1 parent 662bd59 commit 616a84f

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

hal/tests/pinvalidate/pinvalidate.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def find_target_by_path(target_path):
5656

5757
with open(target_path) as pin_names_file:
5858
pin_names_file_content = pin_names_file.read()
59-
59+
6060
target_list_match = re.search(
6161
"\/* MBED TARGET LIST: ([0-9A-Z_,* \n]+)*\/",
6262
pin_names_file_content
@@ -71,7 +71,7 @@ def find_target_by_path(target_path):
7171
re.MULTILINE,
7272
)
7373
)
74-
74+
7575
if not target_list:
7676
print("WARNING: MBED TARGET LIST marker invalid or not found in file " + target_path)
7777
print("Target could not be determined. Only the generic test suite will run. You can manually specify additional suites.")
@@ -98,18 +98,18 @@ def find_target_by_path(target_path):
9898
def find_target_by_name(target_name=""):
9999
"""Find a target by name."""
100100
mbed_os_root = pathlib.Path(__file__).absolute().parents[3]
101-
101+
102102
targets = dict()
103103

104104
for f in mbed_os_root.joinpath('targets').rglob("PinNames.h"):
105105
with open(f) as pin_names_file:
106106
pin_names_file_content = pin_names_file.read()
107-
107+
108108
target_list_match = re.search(
109109
"\/* MBED TARGET LIST: ([0-9A-Z_,* \n]+)*\/",
110110
pin_names_file_content
111111
)
112-
112+
113113
target_list = []
114114
if target_list_match:
115115
target_list = list(
@@ -127,7 +127,7 @@ def find_target_by_name(target_name=""):
127127
else:
128128
for target in target_list:
129129
targets[target] = f
130-
130+
131131
return targets
132132

133133

@@ -150,12 +150,12 @@ def check_markers(test_mode=False):
150150
for f in search_dir.rglob("PinNames.h"):
151151
with open(f) as pin_names_file:
152152
pin_names_file_content = pin_names_file.read()
153-
153+
154154
target_list_match = re.search(
155155
"\/* MBED TARGET LIST: ([0-9A-Z_,* \n]+)*\/",
156156
pin_names_file_content
157157
)
158-
158+
159159
marker_target_list = []
160160
if target_list_match:
161161
marker_target_list = list(
@@ -165,7 +165,7 @@ def check_markers(test_mode=False):
165165
re.MULTILINE,
166166
)
167167
)
168-
168+
169169
if not marker_target_list:
170170
print("WARNING: MBED TARGET LIST marker invalid or not found in file " + str(f))
171171
errors.append({ "file": str(f), "error": "marker invalid or not found"})
@@ -181,7 +181,7 @@ def check_markers(test_mode=False):
181181
if not target_is_valid:
182182
print("WARNING: MBED TARGET LIST in file " + str(f) + " includes target '" + target + "' which doesn't exist in targets.json or is not public")
183183
errors.append({ "file": str(f), "error": "target not found"})
184-
184+
185185
return errors
186186

187187

@@ -190,7 +190,7 @@ def check_duplicate_pinnames_files(test_mode=False):
190190
mbed_os_root = pathlib.Path(__file__).absolute().parents[3]
191191

192192
errors = []
193-
193+
194194
file_hash_dict = dict()
195195

196196
if test_mode:
@@ -202,20 +202,20 @@ def check_duplicate_pinnames_files(test_mode=False):
202202
with open(f) as pin_names_file:
203203
pin_names_file_content = pin_names_file.read()
204204
file_hash_dict[str(f)] = hashlib.md5(pin_names_file_content.encode('utf-8')).hexdigest()
205-
206-
rev_dict = {}
207-
for key, value in file_hash_dict.items():
208-
rev_dict.setdefault(value, set()).add(key)
209-
duplicates = [key for key, values in rev_dict.items()
210-
if len(values) > 1]
211-
205+
206+
rev_dict = {}
207+
for key, value in file_hash_dict.items():
208+
rev_dict.setdefault(value, set()).add(key)
209+
duplicates = [key for key, values in rev_dict.items()
210+
if len(values) > 1]
211+
212212
for duplicate in duplicates:
213213
print("WARNING: Duplicate files")
214214
for file_path, file_hash in file_hash_dict.items():
215215
if file_hash == duplicate:
216216
errors.append({ "file": file_path, "error": "duplicate file"})
217217
print("\t" + file_path)
218-
218+
219219
return errors
220220

221221
def check_duplicate_markers(test_mode=False):
@@ -225,7 +225,7 @@ def check_duplicate_markers(test_mode=False):
225225
errors = []
226226

227227
markers = dict()
228-
228+
229229
if test_mode:
230230
search_dir = pathlib.Path(__file__).parent.joinpath('test_files').absolute()
231231
else:
@@ -234,12 +234,12 @@ def check_duplicate_markers(test_mode=False):
234234
for f in search_dir.rglob("PinNames.h"):
235235
with open(f) as pin_names_file:
236236
pin_names_file_content = pin_names_file.read()
237-
237+
238238
target_list_match = re.search(
239239
"\/* MBED TARGET LIST: ([0-9A-Z_,* \n]+)*\/",
240240
pin_names_file_content
241241
)
242-
242+
243243
marker_target_list = []
244244
if target_list_match:
245245
marker_target_list = list(
@@ -249,7 +249,7 @@ def check_duplicate_markers(test_mode=False):
249249
re.MULTILINE,
250250
)
251251
)
252-
252+
253253
for target in marker_target_list:
254254
if target in markers:
255255
print("WARNING: target duplicate in " + str(f) + ", " + target + " first listed in " + markers[target])
@@ -610,13 +610,13 @@ def print_pretty_html_report(report):
610610
output.append("'>")
611611
output.append(case["result"])
612612
output.append("</td>")
613-
613+
614614
output.append("<td style='color:")
615615
output.append(count_color)
616616
output.append("'>")
617617
output.append(str(len(case["errors"])))
618618
output.append("</td>")
619-
619+
620620
output.append("<td>")
621621
output.extend(error_details)
622622
output.append("</td>")

0 commit comments

Comments
 (0)