Skip to content

Commit

Permalink
Use posix slashes when looking up files from PR changeset
Browse files Browse the repository at this point in the history
This fixes the "Skipping comment for file" warning that was indexing with paths with backslashes on windows.
  • Loading branch information
bwrsandman authored Jan 10, 2024
1 parent 39c59f3 commit af80bb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions post/clang_tidy_review/clang_tidy_review/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit af80bb7

Please sign in to comment.