Skip to content

Commit

Permalink
Fix Ruff linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Apr 28, 2024
1 parent ddc99ee commit 954db23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions cvise.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,14 @@ def get_available_cores():


EPILOG_TEXT = (
"""
f"""
available shortcuts:
S - skip execution of the current pass
D - toggle --print-diff option
For bug reporting instructions, please use:
%s
{CVise.Info.PACKAGE_URL}
"""
% CVise.Info.PACKAGE_URL
)

if __name__ == '__main__':
Expand Down Expand Up @@ -312,7 +311,7 @@ def get_available_cores():
'--version',
action='version',
version=CVise.Info.PACKAGE_STRING
+ (' (%s)' % CVise.Info.GIT_VERSION if CVise.Info.GIT_VERSION != 'unknown' else ''),
+ (f' ({CVise.Info.GIT_VERSION})' if CVise.Info.GIT_VERSION != 'unknown' else ''),
)
parser.add_argument(
'--commands',
Expand Down Expand Up @@ -450,7 +449,7 @@ def get_available_cores():
script.write(f'#!/usr/bin/env {args.shell}\n\n')
script.write(args.commands + '\n')
os.chmod(script.name, 0o744)
logging.info('Using temporary interestingness test: %s' % script.name)
logging.info(f'Using temporary interestingness test: {script.name}')
args.interestingness_test = script.name

test_manager = testing.TestManager(
Expand Down
12 changes: 6 additions & 6 deletions cvise/utils/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def __init__(
def create_root(self):
pass_name = str(self.current_pass).replace('::', '-')
self.root = tempfile.mkdtemp(prefix=f'{self.TEMP_PREFIX}{pass_name}-')
logging.debug('Creating pass root folder: %s' % self.root)
logging.debug(f'Creating pass root folder: {self.root}')

def remove_root(self):
if not self.save_temps:
Expand Down Expand Up @@ -294,10 +294,10 @@ def report_pass_bug(self, test_env, problem):
)

with (crash_dir / 'PASS_BUG_INFO.TXT').open(mode='w') as info_file:
info_file.write('Package: %s\n' % CVise.Info.PACKAGE_STRING)
info_file.write('Git version: %s\n' % CVise.Info.GIT_VERSION)
info_file.write('LLVM version: %s\n' % CVise.Info.LLVM_VERSION)
info_file.write('System: %s\n' % str(platform.uname()))
info_file.write(f'Package: {CVise.Info.PACKAGE_STRING}\n')
info_file.write(f'Git version: {CVise.Info.GIT_VERSION}\n')
info_file.write(f'LLVM version: {CVise.Info.LLVM_VERSION}\n')
info_file.write(f'System: {str(platform.uname())}\n')
info_file.write(PassBugError.MSG.format(self.current_pass, problem, test_env.state, crash_dir))

if self.die_on_pass_bug:
Expand Down Expand Up @@ -345,7 +345,7 @@ def release_folders(self):

@classmethod
def log_key_event(cls, event):
logging.info('****** %s ******' % event)
logging.info(f'****** {event} ******')

def kill_pid_queue(self):
active_pids = set()
Expand Down

0 comments on commit 954db23

Please sign in to comment.