ruff: Fix FURB105 Unnecessary empty string passed to `print`.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-06-30 14:27:42 -04:00 committed by Tim Abbott
parent 5ac6d671fc
commit 6a73006723
11 changed files with 15 additions and 15 deletions

View File

@ -82,7 +82,7 @@ mypy_args += ["--", *python_files, *pyi_files]
rc = subprocess.call([mypy_command, *mypy_args]) rc = subprocess.call([mypy_command, *mypy_args])
if rc != 0: if rc != 0:
print("") print()
print("See https://zulip.readthedocs.io/en/latest/testing/mypy.html for debugging tips.") print("See https://zulip.readthedocs.io/en/latest/testing/mypy.html for debugging tips.")
sys.exit(rc) sys.exit(rc)

View File

@ -140,7 +140,7 @@ or report and ask for help in chat.zulip.org""",
file=sys.stderr, file=sys.stderr,
) )
if os.environ.get("GITHUB_ACTIONS"): if os.environ.get("GITHUB_ACTIONS"):
print("", file=sys.stderr) print(file=sys.stderr)
print( print(
""" """
Screenshots generated on failure are extremely helpful for understanding Screenshots generated on failure are extremely helpful for understanding
@ -150,7 +150,7 @@ below to download and view the generated screenshots.
""", """,
file=sys.stderr, file=sys.stderr,
) )
print("", file=sys.stderr) print(file=sys.stderr)
else: else:
print( print(
"It's also worthy to see screenshots generated on failure stored under var/puppeteer/*.png" "It's also worthy to see screenshots generated on failure stored under var/puppeteer/*.png"

View File

@ -64,4 +64,4 @@ Create default stream groups which the users can choose during sign up.
print(default_stream_group.description) print(default_stream_group.description)
for stream in default_stream_group.streams.all(): for stream in default_stream_group.streams.all():
print(stream.name) print(stream.name)
print("") print()

View File

@ -35,7 +35,7 @@ class Command(ZulipBaseCommand):
print(f"{user_profile.delivery_email} has the following active sessions:") print(f"{user_profile.delivery_email} has the following active sessions:")
for session in user_sessions(user_profile): for session in user_sessions(user_profile):
print(session.expire_date, session.get_decoded()) print(session.expire_date, session.get_decoded())
print("") 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." f"{user_profile.delivery_email} has {get_active_bots_owned_by_user(user_profile).count()} active bots that will also be deactivated."
) )

View File

@ -61,15 +61,15 @@ class Command(ZulipBaseCommand):
if options["for_real"]: if options["for_real"]:
do_delete_old_unclaimed_attachments(delta_weeks) do_delete_old_unclaimed_attachments(delta_weeks)
print("") print()
print("Unclaimed files deleted.") print("Unclaimed files deleted.")
if options["clean_up_storage"]: if options["clean_up_storage"]:
print("") print()
self.clean_attachment_upload_backend(dry_run=not options["for_real"]) self.clean_attachment_upload_backend(dry_run=not options["for_real"])
if not options["for_real"]: if not options["for_real"]:
print("") print()
raise CommandError("This was a dry run. Pass -f to actually delete.") raise CommandError("This was a dry run. Pass -f to actually delete.")
def clean_attachment_upload_backend(self, dry_run: bool = True) -> None: def clean_attachment_upload_backend(self, dry_run: bool = True) -> None:

View File

@ -100,7 +100,7 @@ class Command(ZulipBaseCommand):
tos_prompt = input( tos_prompt = input(
"Do you want to agree to the Zulip Terms of Service and proceed? [Y/n] " "Do you want to agree to the Zulip Terms of Service and proceed? [Y/n] "
) )
print("") print()
if not ( if not (
tos_prompt.lower() == "y" or tos_prompt.lower() == "" or tos_prompt.lower() == "yes" tos_prompt.lower() == "y" or tos_prompt.lower() == "" or tos_prompt.lower() == "yes"
): ):

View File

@ -32,7 +32,7 @@ def fix_topics(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None
# Nothing to do if there are no messages. # Nothing to do if there are no messages.
return return
print("") print()
while lower_bound < max_id: while lower_bound < max_id:
print(f"Processed {lower_bound} / {max_id}") print(f"Processed {lower_bound} / {max_id}")
with connection.cursor() as cursor: with connection.cursor() as cursor:

View File

@ -30,7 +30,7 @@ def fix_stream_names(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -
if len(realm_ids) == 0: if len(realm_ids) == 0:
return return
print("") print()
for realm_id in realm_ids: for realm_id in realm_ids:
print(f"Processing realm {realm_id}") print(f"Processing realm {realm_id}")
realm_stream_dicts = Stream.objects.filter(realm_id=realm_id).values("id", "name") realm_stream_dicts = Stream.objects.filter(realm_id=realm_id).values("id", "name")

View File

@ -44,7 +44,7 @@ def revoke_invitations(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor)
return confirmation_ids return confirmation_ids
print("") print()
for realm_id in Realm.objects.values_list("id", flat=True): for realm_id in Realm.objects.values_list("id", flat=True):
deactivated_user_ids = UserProfile.objects.filter( deactivated_user_ids = UserProfile.objects.filter(
is_active=False, realm_id=realm_id is_active=False, realm_id=realm_id

View File

@ -37,7 +37,7 @@ def fix_email_gateway_attachment_owner(
if len(orphan_attachments) == 0: if len(orphan_attachments) == 0:
return return
print("") print()
print(f"Found {len(orphan_attachments)} email gateway attachments to reattach") print(f"Found {len(orphan_attachments)} email gateway attachments to reattach")
for attachment in orphan_attachments: for attachment in orphan_attachments:
# We look for the message posted by "Internal" at the same # We look for the message posted by "Internal" at the same

View File

@ -152,7 +152,7 @@ def log_extra_usermessage_rows(apps: StateApps, schema_editor: BaseDatabaseSchem
) )
else: else:
log_file = sys.stderr log_file = sys.stderr
print("", file=log_file) print(file=log_file)
stack.enter_context(redirect_stdout(log_file)) stack.enter_context(redirect_stdout(log_file))
for message in messages: for message in messages:
@ -189,7 +189,7 @@ def log_extra_usermessage_rows(apps: StateApps, schema_editor: BaseDatabaseSchem
for um in ums: for um in ums:
read = "(read)" if um.flags & 1 else "(unread)" read = "(read)" if um.flags & 1 else "(unread)"
print(f" {um.user_profile.delivery_email} {read}") print(f" {um.user_profile.delivery_email} {read}")
print("") print()
class Migration(migrations.Migration): class Migration(migrations.Migration):