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

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-01-02 16:51:16 -08:00 committed by Tim Abbott
parent 234d628fee
commit 2c5e114f8b
9 changed files with 20 additions and 23 deletions

View File

@ -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",

View File

@ -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:

View File

@ -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).")

View File

@ -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(

View File

@ -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,
)

View File

@ -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})

View File

@ -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"],

View File

@ -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,
)

View File

@ -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}.",
},