File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
post/clang_tidy_review/clang_tidy_review Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1032,9 +1032,14 @@ def get_line_ranges(diff, files):
1032
1032
1033
1033
line_filter_json = []
1034
1034
for name , lines in lines_by_file .items ():
1035
- # On windows, unidiff has forward slashes but clang-tidy expects backslashes
1036
- name = os .path .join (* name .split ("/" ))
1037
1035
line_filter_json .append ({"name" : name , "lines" : lines })
1036
+ # On windows, unidiff has forward slashes but cl.exe expects backslashes.
1037
+ # However, clang.exe on windows expects forward slashes.
1038
+ # Adding a copy of the line filters with backslashes allows for both cl.exe and clang.exe to work.
1039
+ if os .path .sep == "\\ " :
1040
+ # Converts name to backslashes for the cl.exe line filter.
1041
+ name = os .path .join (* name .split ("/" ))
1042
+ line_filter_json .append ({"name" : name , "lines" : lines })
1038
1043
return json .dumps (line_filter_json , separators = ("," , ":" ))
1039
1044
1040
1045
You can’t perform that action at this time.
0 commit comments