Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

ruff: Fix ISC001 Implicitly concatenated string literals on one line.

Anders Kaseorg2c5e114f8b30
diff --git a/tools/test-backend b/tools/test-backend
index a466c5258d4..7d27b539cf5 100755
--- a/tools/test-backend
+++ b/tools/test-backend
@@ -256,9 +256,7 @@ def main() -> None:
parser.add_argument(
"--rerun",
action="store_true",
- help=(
- "Run the tests which failed the last time " "test-backend was run. Implies not --stop."
- ),
+ help="Run the tests which failed the last time test-backend was run. Implies not --stop.",
)
parser.add_argument(
"--include-webhooks",
diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py
index 1e2fa165293..7938ad8c7f8 100644
--- a/zerver/lib/markdown/__init__.py
+++ b/zerver/lib/markdown/__init__.py
@@ -1694,7 +1694,7 @@ class BlockQuoteProcessor(markdown.blockprocessors.BlockQuoteProcessor):
"""
# Original regex for blockquote is RE = re.compile(r'(^|\n)[ ]{0,3}>[ ]?(.*)')
- RE = re.compile(r"(^|\n)(?!(?:[ ]{0,3}>\s*(?:$|\n))*(?:$|\n))" r"[ ]{0,3}>[ ]?(.*)")
+ RE = re.compile(r"(^|\n)(?!(?:[ ]{0,3}>\s*(?:$|\n))*(?:$|\n))[ ]{0,3}>[ ]?(.*)")
# run() is very slightly forked from the base class; see notes below.
def run(self, parent: Element, blocks: List[str]) -> None:
diff --git a/zerver/management/commands/get_migration_status.py b/zerver/management/commands/get_migration_status.py
index f1fe98a764f..d8ee7fb7fdf 100644
--- a/zerver/management/commands/get_migration_status.py
+++ b/zerver/management/commands/get_migration_status.py
@@ -20,7 +20,7 @@ class Command(BaseCommand):
parser.add_argument(
"--database",
default=DEFAULT_DB_ALIAS,
- help="Nominates a database to synchronize. " 'Defaults to the "default" database.',
+ help='Nominates a database to synchronize. Defaults to the "default" database.',
)
parser.add_argument("--output", help="Path to store the status to (default to stdout).")
diff --git a/zerver/management/commands/send_webhook_fixture_message.py b/zerver/management/commands/send_webhook_fixture_message.py
index 7b3d8b0e6c2..609b6483731 100644
--- a/zerver/management/commands/send_webhook_fixture_message.py
+++ b/zerver/management/commands/send_webhook_fixture_message.py
@@ -32,7 +32,7 @@ approach shown above.
def add_arguments(self, parser: CommandParser) -> None:
parser.add_argument(
- "-f", "--fixture", help="The path to the fixture you'd like to send " "into Zulip"
+ "-f", "--fixture", help="The path to the fixture you'd like to send into Zulip"
)
parser.add_argument(
diff --git a/zerver/tests/test_link_embed.py b/zerver/tests/test_link_embed.py
index daa00d3de4d..8c19e3d82fb 100644
--- a/zerver/tests/test_link_embed.py
+++ b/zerver/tests/test_link_embed.py
@@ -683,7 +683,7 @@ class PreviewTestCase(ZulipTestCase):
self.assertIsNone(cached_data)
msg = Message.objects.select_related("sender").get(id=msg_id)
self.assertEqual(
- ('<p><a href="http://test.org/audio.mp3">' "http://test.org/audio.mp3</a></p>"),
+ '<p><a href="http://test.org/audio.mp3">http://test.org/audio.mp3</a></p>',
msg.rendered_content,
)
@@ -719,7 +719,7 @@ class PreviewTestCase(ZulipTestCase):
self.assertIsNone(cached_data.image)
msg = Message.objects.select_related("sender").get(id=msg_id)
self.assertEqual(
- ('<p><a href="http://test.org/foo.html">' "http://test.org/foo.html</a></p>"),
+ '<p><a href="http://test.org/foo.html">http://test.org/foo.html</a></p>',
msg.rendered_content,
)
@@ -758,7 +758,7 @@ class PreviewTestCase(ZulipTestCase):
self.assertIsNone(cached_data.image)
msg = Message.objects.select_related("sender").get(id=msg_id)
self.assertEqual(
- ('<p><a href="http://test.org/foo.html">' "http://test.org/foo.html</a></p>"),
+ '<p><a href="http://test.org/foo.html">http://test.org/foo.html</a></p>',
msg.rendered_content,
)
@@ -795,7 +795,7 @@ class PreviewTestCase(ZulipTestCase):
self.assertIsNone(cached_data.image)
msg = Message.objects.select_related("sender").get(id=msg_id)
self.assertEqual(
- ('<p><a href="http://test.org/foo.html">' "http://test.org/foo.html</a></p>"),
+ '<p><a href="http://test.org/foo.html">http://test.org/foo.html</a></p>',
msg.rendered_content,
)
diff --git a/zerver/tests/test_markdown.py b/zerver/tests/test_markdown.py
index 542b5195c74..66b5981733c 100644
--- a/zerver/tests/test_markdown.py
+++ b/zerver/tests/test_markdown.py
@@ -2027,7 +2027,7 @@ class MarkdownTest(ZulipTestCase):
rendering_result = render_markdown(msg, content)
self.assertEqual(
rendering_result.rendered_content,
- '<p><span class="user-mention" data-user-id="*">' "@all" "</span> test</p>",
+ '<p><span class="user-mention" data-user-id="*">@all</span> test</p>',
)
self.assertTrue(rendering_result.mentions_wildcard)
@@ -2039,7 +2039,7 @@ class MarkdownTest(ZulipTestCase):
rendering_result = render_markdown(msg, content)
self.assertEqual(
rendering_result.rendered_content,
- '<p><span class="user-mention" data-user-id="*">' "@everyone" "</span> test</p>",
+ '<p><span class="user-mention" data-user-id="*">@everyone</span> test</p>',
)
self.assertTrue(rendering_result.mentions_wildcard)
@@ -2051,7 +2051,7 @@ class MarkdownTest(ZulipTestCase):
rendering_result = render_markdown(msg, content)
self.assertEqual(
rendering_result.rendered_content,
- '<p><span class="user-mention" data-user-id="*">' "@stream" "</span> test</p>",
+ '<p><span class="user-mention" data-user-id="*">@stream</span> test</p>',
)
self.assertTrue(rendering_result.mentions_wildcard)
@@ -2105,7 +2105,7 @@ class MarkdownTest(ZulipTestCase):
rendering_result = render_markdown(msg, content)
self.assertEqual(
rendering_result.rendered_content,
- '<p><span class="user-mention" ' f'data-user-id="{user_id}">' "@King Hamlet</span></p>",
+ f'<p><span class="user-mention" data-user-id="{user_id}">@King Hamlet</span></p>',
)
self.assertEqual(rendering_result.mentions_user_ids, {user_profile.id})
@@ -2113,7 +2113,7 @@ class MarkdownTest(ZulipTestCase):
rendering_result = render_markdown(msg, content)
self.assertEqual(
rendering_result.rendered_content,
- '<p><span class="user-mention" ' f'data-user-id="{user_id}">' "@King Hamlet</span></p>",
+ f'<p><span class="user-mention" data-user-id="{user_id}">@King Hamlet</span></p>',
)
self.assertEqual(rendering_result.mentions_user_ids, {user_profile.id})
diff --git a/zerver/tests/test_message_edit.py b/zerver/tests/test_message_edit.py
index bae919f86c5..82a030ec1cd 100644
--- a/zerver/tests/test_message_edit.py
+++ b/zerver/tests/test_message_edit.py
@@ -712,11 +712,11 @@ class EditMessageTest(EditMessageTestCase):
# Check content of message after edit.
self.assertEqual(
message_history_1[0]["rendered_content"],
- "<p>Here is a link to " '<a href="http://www.zulip.org">zulip</a>.</p>',
+ '<p>Here is a link to <a href="http://www.zulip.org">zulip</a>.</p>',
)
self.assertEqual(
message_history_1[1]["rendered_content"],
- "<p>Here is a link to " '<a href="http://www.zulipchat.com">zulip</a>.</p>',
+ '<p>Here is a link to <a href="http://www.zulipchat.com">zulip</a>.</p>',
)
self.assertEqual(
message_history_1[1]["content_html_diff"],
diff --git a/zerver/tests/test_push_notifications.py b/zerver/tests/test_push_notifications.py
index fab9bc5c067..80c94501900 100644
--- a/zerver/tests/test_push_notifications.py
+++ b/zerver/tests/test_push_notifications.py
@@ -995,7 +995,7 @@ class HandlePushNotificationTest(PushNotificationTest):
)
for _, _, token in gcm_devices:
self.assertIn(
- "INFO:zerver.lib.push_notifications:" f"GCM: Sent {token} as {message.id}",
+ f"INFO:zerver.lib.push_notifications:GCM: Sent {token} as {message.id}",
pn_logger.output,
)
diff --git a/zerver/webhooks/taiga/view.py b/zerver/webhooks/taiga/view.py
index 1587d5789c3..69770595038 100644
--- a/zerver/webhooks/taiga/view.py
+++ b/zerver/webhooks/taiga/view.py
@@ -90,7 +90,7 @@ templates = {
"delete": "[{user}]({user_link}) deleted user story {subject}.",
"due_date": "[{user}]({user_link}) changed due date of user story {subject}"
" from {old} to {new}.",
- "set_due_date": "[{user}]({user_link}) set due date of user story {subject}" " to {new}.",
+ "set_due_date": "[{user}]({user_link}) set due date of user story {subject} to {new}.",
},
"milestone": {
"create": "[{user}]({user_link}) created sprint {subject}.",
@@ -121,9 +121,8 @@ templates = {
"commented": "[{user}]({user_link}) commented on task {subject}.",
"delete": "[{user}]({user_link}) deleted task {subject}.",
"changed_us": "[{user}]({user_link}) moved task {subject} from user story {old} to {new}.",
- "due_date": "[{user}]({user_link}) changed due date of task {subject}"
- " from {old} to {new}.",
- "set_due_date": "[{user}]({user_link}) set due date of task {subject}" " to {new}.",
+ "due_date": "[{user}]({user_link}) changed due date of task {subject} from {old} to {new}.",
+ "set_due_date": "[{user}]({user_link}) set due date of task {subject} to {new}.",
},
"issue": {
"create": "[{user}]({user_link}) created issue {subject}.",
@@ -146,7 +145,7 @@ templates = {
"delete": "[{user}]({user_link}) deleted issue {subject}.",
"due_date": "[{user}]({user_link}) changed due date of issue {subject}"
" from {old} to {new}.",
- "set_due_date": "[{user}]({user_link}) set due date of issue {subject}" " to {new}.",
+ "set_due_date": "[{user}]({user_link}) set due date of issue {subject} to {new}.",
"blocked": "[{user}]({user_link}) blocked issue {subject}.",
"unblocked": "[{user}]({user_link}) unblocked issue {subject}.",
},