Skip to content

Commit 4cfac55

Browse files
committed
moved path normalization logic from split_list_arg() to normalize_paths()
1 parent bacf977 commit 4cfac55

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

run-clang-format.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,13 @@ def print_trouble(prog, message, use_colors):
243243
error_text = bold_red(error_text)
244244
print("{}: {} {}".format(prog, error_text, message), file=sys.stderr)
245245

246-
246+
def normalize_paths(paths):
247+
"""
248+
Normalizes backward slashes in each path in list of paths
249+
Ex)
250+
"features/Test\ Features/feature.cpp" => "features/Test Features/feature.cpp"
251+
"""
252+
return [path.replace("\\","") for path in paths]
247253
def split_list_arg(arg):
248254
"""
249255
If arg is a list containing a single argument it is split into multiple elements.
@@ -255,7 +261,7 @@ def split_list_arg(arg):
255261
# split list by regex
256262
paths = re.split(pattern, arg[0])
257263
print(paths)
258-
paths = [path.replace("\\","") for path in paths]
264+
paths = normalize_paths(paths)
259265
# for path in paths:
260266
# print(path)
261267
# # normalize paths by removing forward slashes

0 commit comments

Comments
 (0)