Skip to content

Commit f4543ba

Browse files
authored
Minor coverage bot issue (4 lines) (pyccel#1907)
The coverage bot is only showing 1 line errors. This makes it hard to understand the error as people often assume that the error is on all displayed lines (6 lines are shown for context when the error is on a single line). This is not what the coverage bot is designed to do but two minor errors in the script are causing such display problems. 1. The last_valid_line_idx was incorrectly defined 2. `i` was used for a loop inside a loop over `i` leading to the value in the outer loop being incorrectly overwritten
1 parent ba3279e commit f4543ba

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ci_tools/coverage_analysis_tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ def get_json_summary(untested, content_lines, existing_comments, diff):
259259
else:
260260
end_line = line_indices[-1]
261261
last_valid_line = start_line
262-
last_valid_line_idx = next(i for i in diff[f]['addition'] if i == last_valid_line)
263-
for i in diff[f]['addition'][last_valid_line_idx:]:
264-
if i-last_valid_line < 6:
265-
last_valid_line = i
262+
last_valid_line_idx = next(k for k,l in enumerate(diff[f]['addition']) if l == last_valid_line)
263+
for k in diff[f]['addition'][last_valid_line_idx:]:
264+
if k-last_valid_line < 6:
265+
last_valid_line = k
266266
else:
267267
break
268268
end_line = min(end_line, last_valid_line)

0 commit comments

Comments
 (0)