diff --git a/tools/run-mypy b/tools/run-mypy index 9f04446c..7e002ed5 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -123,7 +123,7 @@ files_dict = lister.list_files( ftypes=["py", "pyi"], use_shebang=True, modified_only=args.modified, - exclude=exclude + ["stubs"], + exclude=[*exclude, "stubs"], group_by_ftype=True, ) @@ -154,7 +154,7 @@ status = 0 for repo, python_files in repo_python_files.items(): print(f"Running mypy for `{repo}`.", flush=True) if python_files: - result = subprocess.call([mypy_command, "--"] + python_files) + result = subprocess.call([mypy_command, "--", *python_files]) if result != 0: status = result else: diff --git a/zulip/integrations/bridge_with_matrix/test_matrix.py b/zulip/integrations/bridge_with_matrix/test_matrix.py index 087d07b3..1689e72a 100644 --- a/zulip/integrations/bridge_with_matrix/test_matrix.py +++ b/zulip/integrations/bridge_with_matrix/test_matrix.py @@ -66,7 +66,7 @@ def new_temp_dir() -> Iterator[str]: class MatrixBridgeScriptTests(TestCase): def output_from_script(self, options: List[str]) -> List[str]: popen = Popen( - [sys.executable, script] + options, stdin=PIPE, stdout=PIPE, universal_newlines=True + [sys.executable, script, *options], stdin=PIPE, stdout=PIPE, universal_newlines=True ) return popen.communicate()[0].strip().split("\n") diff --git a/zulip/integrations/zephyr/zephyr_mirror_backend.py b/zulip/integrations/zephyr/zephyr_mirror_backend.py index a4ab9773..650dffaf 100755 --- a/zulip/integrations/zephyr/zephyr_mirror_backend.py +++ b/zulip/integrations/zephyr/zephyr_mirror_backend.py @@ -719,7 +719,7 @@ def send_authed_zephyr(zwrite_args: List[str], content: str) -> Tuple[int, str]: def send_unauthed_zephyr(zwrite_args: List[str], content: str) -> Tuple[int, str]: - return send_zephyr(zwrite_args + ["-d"], content) + return send_zephyr([*zwrite_args, "-d"], content) def zcrypt_encrypt_content(zephyr_class: str, instance: str, content: str) -> Optional[str]: diff --git a/zulip_bots/zulip_bots/bots/converter/converter.py b/zulip_bots/zulip_bots/bots/converter/converter.py index 62577667..de415076 100644 --- a/zulip_bots/zulip_bots/bots/converter/converter.py +++ b/zulip_bots/zulip_bots/bots/converter/converter.py @@ -57,8 +57,7 @@ def get_bot_converter_response(message: Dict[str, str], bot_handler: BotHandler) content = message["content"] words = content.lower().split() - convert_indexes = [i for i, word in enumerate(words) if word == "@convert"] - convert_indexes = [-1] + convert_indexes + convert_indexes = [-1, *(i for i, word in enumerate(words) if word == "@convert")] results = [] for convert_index in convert_indexes: