Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
ruff: Fix FURB105 Unnecessary empty string passed to `print`.
Anders Kaseorg6a73006723be
diff --git a/tools/run-mypy b/tools/run-mypyindex 88d49918671..2a90b69004d 100755--- a/tools/run-mypy+++ b/tools/run-mypy@@ -82,7 +82,7 @@ mypy_args += ["--", *python_files, *pyi_files]rc = subprocess.call([mypy_command, *mypy_args])if rc != 0:- print("")+ print()print("See https://zulip.readthedocs.io/en/latest/testing/mypy.html for debugging tips.")sys.exit(rc)diff --git a/tools/test-js-with-puppeteer b/tools/test-js-with-puppeteerindex e81df9135b2..0ac53d94855 100755--- a/tools/test-js-with-puppeteer+++ b/tools/test-js-with-puppeteer@@ -140,7 +140,7 @@ or report and ask for help in chat.zulip.org""",file=sys.stderr,)if os.environ.get("GITHUB_ACTIONS"):- print("", file=sys.stderr)+ print(file=sys.stderr)print("""Screenshots generated on failure are extremely helpful for understanding@@ -150,7 +150,7 @@ below to download and view the generated screenshots.""",file=sys.stderr,)- print("", file=sys.stderr)+ print(file=sys.stderr)else:print("It's also worthy to see screenshots generated on failure stored under var/puppeteer/*.png"diff --git a/zerver/management/commands/create_default_stream_groups.py b/zerver/management/commands/create_default_stream_groups.pyindex 8565d5cb3ff..00d92d0586b 100644--- a/zerver/management/commands/create_default_stream_groups.py+++ b/zerver/management/commands/create_default_stream_groups.py@@ -64,4 +64,4 @@ Create default stream groups which the users can choose during sign up.print(default_stream_group.description)for stream in default_stream_group.streams.all():print(stream.name)- print("")+ print()diff --git a/zerver/management/commands/deactivate_user.py b/zerver/management/commands/deactivate_user.pyindex 63f0f42ee88..af9f4bbaf1c 100644--- a/zerver/management/commands/deactivate_user.py+++ b/zerver/management/commands/deactivate_user.py@@ -35,7 +35,7 @@ class Command(ZulipBaseCommand):print(f"{user_profile.delivery_email} has the following active sessions:")for session in user_sessions(user_profile):print(session.expire_date, session.get_decoded())- print("")+ print()print(f"{user_profile.delivery_email} has {get_active_bots_owned_by_user(user_profile).count()} active bots that will also be deactivated.")diff --git a/zerver/management/commands/delete_old_unclaimed_attachments.py b/zerver/management/commands/delete_old_unclaimed_attachments.pyindex a83e81a7c33..00a9f2317ac 100644--- a/zerver/management/commands/delete_old_unclaimed_attachments.py+++ b/zerver/management/commands/delete_old_unclaimed_attachments.py@@ -61,15 +61,15 @@ class Command(ZulipBaseCommand):if options["for_real"]:do_delete_old_unclaimed_attachments(delta_weeks)- print("")+ print()print("Unclaimed files deleted.")if options["clean_up_storage"]:- print("")+ print()self.clean_attachment_upload_backend(dry_run=not options["for_real"])if not options["for_real"]:- print("")+ print()raise CommandError("This was a dry run. Pass -f to actually delete.")def clean_attachment_upload_backend(self, dry_run: bool = True) -> None:diff --git a/zerver/management/commands/register_server.py b/zerver/management/commands/register_server.pyindex 8772ebbf68a..edb8ae629a0 100644--- a/zerver/management/commands/register_server.py+++ b/zerver/management/commands/register_server.py@@ -100,7 +100,7 @@ class Command(ZulipBaseCommand):tos_prompt = input("Do you want to agree to the Zulip Terms of Service and proceed? [Y/n] ")- print("")+ print()if not (tos_prompt.lower() == "y" or tos_prompt.lower() == "" or tos_prompt.lower() == "yes"):diff --git a/zerver/migrations/0371_invalid_characters_in_topics.py b/zerver/migrations/0371_invalid_characters_in_topics.pyindex 90dbb5c8129..4cade25f5d5 100644--- a/zerver/migrations/0371_invalid_characters_in_topics.py+++ b/zerver/migrations/0371_invalid_characters_in_topics.py@@ -32,7 +32,7 @@ def fix_topics(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None# Nothing to do if there are no messages.return- print("")+ print()while lower_bound < max_id:print(f"Processed {lower_bound} / {max_id}")with connection.cursor() as cursor:diff --git a/zerver/migrations/0375_invalid_characters_in_stream_names.py b/zerver/migrations/0375_invalid_characters_in_stream_names.pyindex ac497755a1b..9769df97f55 100644--- a/zerver/migrations/0375_invalid_characters_in_stream_names.py+++ b/zerver/migrations/0375_invalid_characters_in_stream_names.py@@ -30,7 +30,7 @@ def fix_stream_names(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -if len(realm_ids) == 0:return- print("")+ print()for realm_id in realm_ids:print(f"Processing realm {realm_id}")realm_stream_dicts = Stream.objects.filter(realm_id=realm_id).values("id", "name")diff --git a/zerver/migrations/0383_revoke_invitations_from_deactivated_users.py b/zerver/migrations/0383_revoke_invitations_from_deactivated_users.pyindex f2d9def5cc0..e57d2ba9fa5 100644--- a/zerver/migrations/0383_revoke_invitations_from_deactivated_users.py+++ b/zerver/migrations/0383_revoke_invitations_from_deactivated_users.py@@ -44,7 +44,7 @@ def revoke_invitations(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor)return confirmation_ids- print("")+ print()for realm_id in Realm.objects.values_list("id", flat=True):deactivated_user_ids = UserProfile.objects.filter(is_active=False, realm_id=realm_iddiff --git a/zerver/migrations/0423_fix_email_gateway_attachment_owner.py b/zerver/migrations/0423_fix_email_gateway_attachment_owner.pyindex 53333c3b5ce..e91a9b9e5ea 100644--- a/zerver/migrations/0423_fix_email_gateway_attachment_owner.py+++ b/zerver/migrations/0423_fix_email_gateway_attachment_owner.py@@ -37,7 +37,7 @@ def fix_email_gateway_attachment_owner(if len(orphan_attachments) == 0:return- print("")+ print()print(f"Found {len(orphan_attachments)} email gateway attachments to reattach")for attachment in orphan_attachments:# We look for the message posted by "Internal" at the samediff --git a/zerver/migrations/0501_delete_dangling_usermessages.py b/zerver/migrations/0501_delete_dangling_usermessages.pyindex 56e19959649..f7c9ebc7e5e 100644--- a/zerver/migrations/0501_delete_dangling_usermessages.py+++ b/zerver/migrations/0501_delete_dangling_usermessages.py@@ -152,7 +152,7 @@ def log_extra_usermessage_rows(apps: StateApps, schema_editor: BaseDatabaseSchem)else:log_file = sys.stderr- print("", file=log_file)+ print(file=log_file)stack.enter_context(redirect_stdout(log_file))for message in messages:@@ -189,7 +189,7 @@ def log_extra_usermessage_rows(apps: StateApps, schema_editor: BaseDatabaseSchemfor um in ums:read = "(read)" if um.flags & 1 else "(unread)"print(f" {um.user_profile.delivery_email} {read}")- print("")+ print()class Migration(migrations.Migration):