Skip to content

Commit 610683e

Browse files
committed
ruff: Fix RUF005 Consider unpacking instead of concatenation.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 12e63f4 commit 610683e

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

tools/run-mypy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ files_dict = lister.list_files(
123123
ftypes=["py", "pyi"],
124124
use_shebang=True,
125125
modified_only=args.modified,
126-
exclude=exclude + ["stubs"],
126+
exclude=[*exclude, "stubs"],
127127
group_by_ftype=True,
128128
)
129129

@@ -154,7 +154,7 @@ status = 0
154154
for repo, python_files in repo_python_files.items():
155155
print(f"Running mypy for `{repo}`.", flush=True)
156156
if python_files:
157-
result = subprocess.call([mypy_command, "--"] + python_files)
157+
result = subprocess.call([mypy_command, "--", *python_files])
158158
if result != 0:
159159
status = result
160160
else:

zulip/integrations/bridge_with_matrix/test_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def new_temp_dir() -> Iterator[str]:
6666
class MatrixBridgeScriptTests(TestCase):
6767
def output_from_script(self, options: List[str]) -> List[str]:
6868
popen = Popen(
69-
[sys.executable, script] + options, stdin=PIPE, stdout=PIPE, universal_newlines=True
69+
[sys.executable, script, *options], stdin=PIPE, stdout=PIPE, universal_newlines=True
7070
)
7171
return popen.communicate()[0].strip().split("\n")
7272

zulip/integrations/zephyr/zephyr_mirror_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ def send_authed_zephyr(zwrite_args: List[str], content: str) -> Tuple[int, str]:
719719

720720

721721
def send_unauthed_zephyr(zwrite_args: List[str], content: str) -> Tuple[int, str]:
722-
return send_zephyr(zwrite_args + ["-d"], content)
722+
return send_zephyr([*zwrite_args, "-d"], content)
723723

724724

725725
def zcrypt_encrypt_content(zephyr_class: str, instance: str, content: str) -> Optional[str]:

zulip_bots/zulip_bots/bots/converter/converter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def get_bot_converter_response(message: Dict[str, str], bot_handler: BotHandler)
5757
content = message["content"]
5858

5959
words = content.lower().split()
60-
convert_indexes = [i for i, word in enumerate(words) if word == "@convert"]
61-
convert_indexes = [-1] + convert_indexes
60+
convert_indexes = [-1, *(i for i, word in enumerate(words) if word == "@convert")]
6261
results = []
6362

6463
for convert_index in convert_indexes:

0 commit comments

Comments
 (0)