From 78874a15e6962033230b3397ab6f681c87e39ccd Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Sat, 7 Jan 2023 17:02:11 +0100 Subject: [PATCH] packages/cli: linter fixes --- image/image.py | 2 +- packages/cli.py | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/image/image.py b/image/image.py index 1cf1887..e4b2c73 100644 --- a/image/image.py +++ b/image/image.py @@ -64,7 +64,7 @@ def shrink_fs(loop_device: str, file: str, sector_size: int): logging.debug(f'Finding end block of shrunken filesystem on {loop_device}p2') blocks = int(re.search('is now [0-9]+', result.stdout.decode('utf-8')).group(0).split(' ')[2]) # type: ignore - sectors = blocks * sectors_blocks_factor #+ 157812 - 25600 + sectors = blocks * sectors_blocks_factor logging.debug(f'Shrinking partition at {loop_device}p2 to {sectors} sectors') child_proccess = subprocess.Popen( diff --git a/packages/cli.py b/packages/cli.py index b200db5..1ac93db 100644 --- a/packages/cli.py +++ b/packages/cli.py @@ -224,15 +224,17 @@ def cmd_sideload(paths: Iterable[str], arch: Optional[Arch] = None, no_build: bo logging.fatal("No packages matched") return scp_put_files(files, '/tmp').check_returncode() - run_ssh_command([ - 'sudo', - 'pacman', - '-U', - ] + [os.path.join('/tmp', os.path.basename(file)) for file in files] + [ - '--noconfirm', - "'--overwrite=\\*'", - ], - alloc_tty=True).check_returncode() + run_ssh_command( + [ + 'sudo', + 'pacman', + '-U', + *[os.path.join('/tmp', os.path.basename(file)) for file in files], + '--noconfirm', + "'--overwrite=\\*'", + ], + alloc_tty=True, + ).check_returncode() CLEAN_LOCATIONS = ['src', 'pkg', *SRCINFO_CACHE_FILES] @@ -439,7 +441,7 @@ def cmd_check(paths): formatted = False reason = 'Found literal " although no special character was found in the line to justify the usage of a literal "' - if "'" in line and not '"' in line: + if "'" in line and '"' not in line: formatted = False reason = 'Found literal \' although either a literal " or no qoutes should be used'