From 9dee8a2a50a539cdf15867016f50c19bcadec02c Mon Sep 17 00:00:00 2001 From: bohendo Date: Fri, 29 Mar 2024 15:08:29 -0400 Subject: [PATCH] fix lint/formatting problems --- slither/tools/mutator/__main__.py | 2 +- slither/tools/mutator/utils/file_handling.py | 4 ++-- slither/tools/mutator/utils/testing_generated_mutant.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/slither/tools/mutator/__main__.py b/slither/tools/mutator/__main__.py index 15a695a9e..8a7ce3e1a 100644 --- a/slither/tools/mutator/__main__.py +++ b/slither/tools/mutator/__main__.py @@ -255,7 +255,7 @@ def main() -> None: # pylint: disable=too-many-statements,too-many-branches,too if contract.name in contract_names and contract.name not in mutated_contracts: target_contract = contract break - elif not contract_names and contract.name.lower() == file_name.lower(): + if not contract_names and contract.name.lower() == file_name.lower(): target_contract = contract break diff --git a/slither/tools/mutator/utils/file_handling.py b/slither/tools/mutator/utils/file_handling.py index 15f2b9506..7c02ce099 100644 --- a/slither/tools/mutator/utils/file_handling.py +++ b/slither/tools/mutator/utils/file_handling.py @@ -42,7 +42,7 @@ def transfer_and_delete(files_dict: Dict[str, HashedPath]) -> None: del backuped_files[original_path] except FileNotFoundError as e: # pylint: disable=broad-except - logger.error(f"Error transferring content: %s", e) + logger.error("Error transferring content: %s", e) global_counter = {} @@ -92,7 +92,7 @@ def reset_file(file: str) -> None: source_file.write(duplicate_content) except Exception as e: # pylint: disable=broad-except - logger.error(f"Error resetting file: %s", e) + logger.error("Error resetting file: %s", e) def get_sol_file_list(codebase: Path, ignore_paths: Union[List[str], None]) -> List[str]: diff --git a/slither/tools/mutator/utils/testing_generated_mutant.py b/slither/tools/mutator/utils/testing_generated_mutant.py index a1f54df3b..39e7d39de 100644 --- a/slither/tools/mutator/utils/testing_generated_mutant.py +++ b/slither/tools/mutator/utils/testing_generated_mutant.py @@ -35,7 +35,7 @@ def run_test_cmd(cmd: str, timeout: int | None, target_file: str | None, verbose elif "hardhat test" in cmd or "truffle test" in cmd and "--bail" not in cmd: cmd += " --bail" - if timeout is None and "hardhat" not in cmd: # hardhat doesn't support --force flag on tests + if timeout is None and "hardhat" not in cmd: # hardhat doesn't support --force flag on tests # if no timeout, ensure all contracts are recompiled w/out using any cache cmd += " --force"