Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better error handling for wrong diff format #276

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion coverage_comment/coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@
current_file = pathlib.Path(line.removeprefix(added_filename_prefix))
continue
if line.startswith("@@"):
assert current_file
if current_file is None:
raise ValueError(f"Unexpected diff output format: \n{diff}")

Check warning on line 292 in coverage_comment/coverage.py

View workflow job for this annotation

GitHub Actions / Run tests & display coverage

This line has no coverage
lines = parse_line_number_diff_line(line)
result.setdefault(current_file, []).extend(lines)
continue
Expand Down
Loading