Skip to content

Commit

Permalink
format: run ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Apr 15, 2024
1 parent ba0d257 commit 00bdd8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cvise.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ def get_available_cores():
'--stopping-threshold',
default=1.0,
type=float,
help='CVise will stop reducing a test case once it has reduced by this fraction of its original size. Between 0.0 and 1.0.')
help='CVise will stop reducing a test case once it has reduced by this fraction of its original size. Between 0.0 and 1.0.',
)

args = parser.parse_args()

Expand Down
10 changes: 7 additions & 3 deletions cvise/cvise.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,13 @@ def _run_main_passes(self, passes):
met_stopping_threshold = False
for p in passes:
# Exit early if we're already reduced enough
improvement = (self.test_manager.orig_total_file_size - total_file_size) / self.test_manager.orig_total_file_size
logging.info(f'Termination check: stopping threshold is {self.test_manager.stopping_threshold}; current improvement is {improvement}')
if (improvement >= self.test_manager.stopping_threshold):
improvement = (
self.test_manager.orig_total_file_size - total_file_size
) / self.test_manager.orig_total_file_size
logging.info(
f'Termination check: stopping threshold is {self.test_manager.stopping_threshold}; current improvement is {improvement}'
)
if improvement >= self.test_manager.stopping_threshold:
met_stopping_threshold = True
break
if not p.check_prerequisites():
Expand Down

0 comments on commit 00bdd8c

Please sign in to comment.