Skip to content

Commit

Permalink
Exit early if line ranges is empty
Browse files Browse the repository at this point in the history
This happens if the PR only removes lines
  • Loading branch information
ZedThree committed Feb 23, 2021
1 parent 3a1a5e1 commit c969128
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions review.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ def main(
print(f"Checking these files: {files}", flush=True)

line_ranges = get_line_ranges(diff, files)
if line_ranges == "[]":
print("No lines added in this PR!")
return

print(f"Line filter for clang-tidy:\n{line_ranges}\n")

clang_tidy_warnings = get_clang_tidy_warnings(
Expand Down

0 comments on commit c969128

Please sign in to comment.