diff --git a/post/clang_tidy_review/clang_tidy_review/__init__.py b/post/clang_tidy_review/clang_tidy_review/__init__.py index 1273206..31bc672 100644 --- a/post/clang_tidy_review/clang_tidy_review/__init__.py +++ b/post/clang_tidy_review/clang_tidy_review/__init__.py @@ -548,7 +548,7 @@ def format_diff_line(diagnostic, offset_lookup, source_line, line_offset, line_n return code_blocks, end_line -def try_relative(path): +def try_relative(path) -> pathlib.Path: """Try making `path` relative to current directory, otherwise make it an absolute path""" try: here = pathlib.Path.cwd() @@ -686,7 +686,7 @@ def create_review_file( notes=diagnostic.get("Notes", []), ) - rel_path = str(try_relative(get_diagnostic_file_path(diagnostic, build_dir))) + rel_path = try_relative(get_diagnostic_file_path(diagnostic, build_dir)).as_posix() # diff lines are 1-indexed source_line = 1 + find_line_number_from_offset( offset_lookup,