Skip to content

Commit fee86da

Browse files
committed
refactored split_list_arg()
1 parent 4cfac55 commit fee86da

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

run-clang-format.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -250,26 +250,27 @@ def normalize_paths(paths):
250250
"features/Test\ Features/feature.cpp" => "features/Test Features/feature.cpp"
251251
"""
252252
return [path.replace("\\","") for path in paths]
253+
253254
def split_list_arg(arg):
254255
"""
255256
If arg is a list containing a single argument it is split into multiple elements.
256257
Otherwise it is returned unchanged
257258
Workaround for GHA not allowing list arguments
258259
"""
259260
pattern = r'(?<!\\)\s+'
260-
if len(arg) == 1:
261-
# split list by regex
262-
paths = re.split(pattern, arg[0])
263-
print(paths)
264-
paths = normalize_paths(paths)
265-
# for path in paths:
266-
# print(path)
267-
# # normalize paths by removing forward slashes
268-
# path = path.replace("\\", "dfgdf")
269-
# print(path)
270-
print(paths)
271-
return paths
272-
return arg[0].split() if len(arg) == 1 else arg
261+
# if len(arg) == 1:
262+
# # split list by regex
263+
# paths = re.split(pattern, arg[0])
264+
# print(paths)
265+
# paths = normalize_paths(paths)
266+
# # for path in paths:
267+
# # print(path)
268+
# # # normalize paths by removing forward slashes
269+
# # path = path.replace("\\", "dfgdf")
270+
# # print(path)
271+
# print(paths)
272+
# return paths
273+
return normalize_paths(re.split(pattern, arg[0])) if len(arg) == 1 else arg
273274

274275

275276
def main():

0 commit comments

Comments
 (0)