Skip to content

Commit 6f48fe0

Browse files
Mark R. Tuttlemarkrtuttle
authored andcommitted
Code cleanup in response to code review
1 parent 3f93049 commit 6f48fe0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/cbmc_viewer/coveraget.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def update_coverage(coverage, path, func, line, status):
481481
# subelements of the goal in CBMC's xml or json coverage output.
482482

483483
def parse_lines(string):
484-
"Extract line numbers from the string encoding of line numbers used in coverage output"
484+
"""Extract line numbers from the string encoding of line numbers used in coverage output"""
485485

486486
# string is an encoding of a set of line numbers like
487487
# "1,3,6" -> {1, 3, 6}
@@ -492,15 +492,14 @@ def parse_lines(string):
492492
bounds = group.split('-')
493493
if len(bounds) == 1:
494494
lines.add(int(bounds[0]))
495-
continue
496-
if len(bounds) == 2:
495+
elif len(bounds) == 2:
497496
lines.update(range(int(bounds[0]), int(bounds[1])+1))
498-
continue
499-
raise UserWarning(f"Unexpected encoding of line numbers: {string}")
497+
else:
498+
raise UserWarning(f"Unexpected encoding of line numbers: {string}")
500499
return sorted(lines)
501500

502501
def parse_description(description):
503-
"Extract basic block source lines from a coverage goal's textual description"
502+
"""Extract basic block source lines from a coverage goal's textual description"""
504503

505504
try:
506505
# description is "block N (lines BASIC_BLOCK)"
@@ -526,7 +525,7 @@ def parse_description(description):
526525
raise UserWarning(f'Unexpected coverage goal description: "{description}"') from error
527526

528527
def parse_basic_block_lines(basic_block_lines):
529-
"Extract basic block source lines from a coverage goal's xml subelement"
528+
"""Extract basic block source lines from a coverage goal's xml subelement"""
530529

531530
if basic_block_lines is None:
532531
return []
@@ -548,7 +547,7 @@ def parse_basic_block_lines(basic_block_lines):
548547
raise UserWarning(f'Unexpected coverage goal xml data: "{basic_block_lines}"') from error
549548

550549
def parse_basicBlockLines(basicBlockLines): # pylint: disable=invalid-name
551-
"Extract basic block source lines from a coverage goal's json data"
550+
"""Extract basic block source lines from a coverage goal's json data"""
552551

553552
if basicBlockLines is None:
554553
return []

0 commit comments

Comments
 (0)