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-10-27 22:12:49 -07:00
parent 2f581293d9
commit c471f26d45
13 changed files with 20 additions and 22 deletions

View file

@ -122,7 +122,7 @@ at <https://zulip.com/integrations/doc/trello>.
parser.add_argument(
"--trello-board-id",
required=True,
help=("The Trello board short ID. Can usually be found " "in the URL of the Trello board."),
help=("The Trello board short ID. Can usually be found in the URL of the Trello board."),
)
parser.add_argument(
"--trello-api-key",

View file

@ -41,7 +41,7 @@ Zulip API configuration:
expanded_test_path = os.path.abspath(os.path.expanduser(test_path))
self.assertEqual(
str(cm.exception),
"api_key or email not specified and " f"file {expanded_test_path} does not exist",
f"api_key or email not specified and file {expanded_test_path} does not exist",
)

View file

@ -1395,7 +1395,7 @@ class Client:
def list_subscriptions(self, request: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
logger.warning(
"list_subscriptions() is deprecated." " Please use get_subscriptions() instead."
"list_subscriptions() is deprecated. Please use get_subscriptions() instead."
)
return self.get_subscriptions(request)
@ -1699,7 +1699,7 @@ class Client:
if message_id is None:
if propagate_mode != "change_all":
raise AttributeError(
"A message_id must be provided if " 'propagate_mode isn\'t "change_all"'
'A message_id must be provided if propagate_mode isn\'t "change_all"'
)
# ask the server for the latest message ID in the topic.

View file

@ -142,7 +142,7 @@ class BaremetricsHandler:
response = "**Listing sources:** \n"
for index, source in enumerate(sources_data):
response += (
"{_count}.ID: {id}\n" "Provider: {provider}\n" "Provider ID: {provider_id}\n\n"
"{_count}.ID: {id}\nProvider: {provider}\nProvider ID: {provider_id}\n\n"
).format(_count=index + 1, **source)
return response

View file

@ -401,7 +401,7 @@ def make_loss_response(board: chess.Board, reason: str) -> str:
Returns: The loss response string.
"""
return ("*{}* {}. **{}** wins!\n\n" "{}").format(
return ("*{}* {}. **{}** wins!\n\n{}").format(
"White" if board.turn else "Black",
reason,
"Black" if board.turn else "White",
@ -418,7 +418,7 @@ def make_not_legal_response(board: chess.Board, move_san: str) -> str:
Returns: The not-legal-move response string.
"""
return ("Sorry, the move *{}* isn't legal.\n\n" "{}" "\n\n\n" "{}").format(
return ("Sorry, the move *{}* isn't legal.\n\n{}\n\n\n{}").format(
move_san, make_str(board, board.turn), make_footer()
)

View file

@ -96,7 +96,7 @@ def get_bot_giphy_response(
"let's try again later! :grin:"
)
except GiphyNoResultException:
return f'Sorry, I don\'t have a GIF for "{keyword}"! ' ":astonished:"
return f'Sorry, I don\'t have a GIF for "{keyword}"! :astonished:'
return (
f"[Click to enlarge]({gif_url})"
"[](/static/images/interactive-bot/giphy/powered-by-giphy.png)"

View file

@ -19,7 +19,7 @@ def getInfo():
:return: Info on how to start the game
"""
return "To start a game, mention me and add `create`. A game will start " "in that topic. "
return "To start a game, mention me and add `create`. A game will start in that topic. "
def getHelp():
@ -70,7 +70,7 @@ def beat(message, topic_name, merels_storage):
p2 = [int(x) for x in match.group(3).split(",")]
if mechanics.get_take_status(topic_name, merels_storage) == 1:
raise BadMoveException("Take is required to proceed." " Please try again.\n")
raise BadMoveException("Take is required to proceed. Please try again.\n")
responses += mechanics.move_man(topic_name, p1, p2, merels_storage) + "\n"
no_moves = after_event_checkup(responses, topic_name, merels_storage)
@ -98,7 +98,7 @@ def beat(message, topic_name, merels_storage):
responses = ""
if mechanics.get_take_status(topic_name, merels_storage) == 1:
raise BadMoveException("Take is required to proceed." " Please try again.\n")
raise BadMoveException("Take is required to proceed. Please try again.\n")
responses += mechanics.put_man(topic_name, p1[0], p1[1], merels_storage) + "\n"
no_moves = after_event_checkup(responses, topic_name, merels_storage)
@ -162,7 +162,7 @@ def check_any_moves(topic_name, merels_storage):
"""
if not mechanics.can_make_any_move(topic_name, merels_storage):
mechanics.update_change_turn(topic_name, merels_storage)
return "Cannot make any move on the grid. Switching to " "previous player.\n"
return "Cannot make any move on the grid. Switching to previous player.\n"
return ""

View file

@ -15,7 +15,7 @@ class TestMerelsBot(BotTestCase, DefaultTests):
)
res = self.get_response(message)
self.assertEqual(
res["content"], "You are not in a game at the moment." " Type `help` for help."
res["content"], "You are not in a game at the moment. Type `help` for help."
)
# FIXME: Add tests for computer moves

View file

@ -22,7 +22,7 @@ def execute(message: str, apikey: str) -> str:
len_params = len(params)
if len_params < 2:
return failed("You **must** provide at least an URL to perform a " "check.")
return failed("You **must** provide at least an URL to perform a check.")
options = {
"secret": apikey,
@ -65,7 +65,7 @@ def execute(message: str, apikey: str) -> str:
# the user needs to modify the asset_count. There are probably ways
# to counteract this, but I think this is more fast to run.
else:
return "Unknown command. Available commands: `check <website> " "[params]`"
return "Unknown command. Available commands: `check <website> [params]`"
def failed(message: str) -> str:

View file

@ -253,9 +253,7 @@ class TicTacToeMessageHandler:
return f"{original_player} put a token at {move_info}"
def game_start_message(self) -> str:
return (
"Welcome to tic-tac-toe!" "To make a move, type @-mention `move <number>` or `<number>`"
)
return "Welcome to tic-tac-toe!To make a move, type @-mention `move <number>` or `<number>`"
class ticTacToeHandler(GameAdapter):

View file

@ -83,7 +83,7 @@ class TestTrelloBot(BotTestCase, DefaultTests):
with self.mock_http_conversation("get_lists"):
self.verify_reply(
"get-all-lists TEST",
("**Lists:**\n" "1. TEST_A\n" " * TEST_1\n" "2. TEST_B\n" " * TEST_2"),
("**Lists:**\n1. TEST_A\n * TEST_1\n2. TEST_B\n * TEST_2"),
)
def test_command_exceptions(self) -> None:

View file

@ -108,5 +108,5 @@ class TestYoutubeBot(BotTestCase, DefaultTests):
"requests.get", side_effect=ConnectionError()
), patch("logging.exception"):
self.verify_reply(
"Wow !", "Uh-Oh, couldn't process the request " "right now.\nPlease again later"
"Wow !", "Uh-Oh, couldn't process the request right now.\nPlease again later"
)

View file

@ -37,7 +37,7 @@ class YoutubeHandler:
assert e.response is not None
if e.response.json()["error"]["errors"][0]["reason"] == "keyInvalid":
bot_handler.quit(
"Invalid key." "Follow the instructions in doc.md for setting API key."
"Invalid key.Follow the instructions in doc.md for setting API key."
)
else:
raise
@ -112,7 +112,7 @@ def get_bot_response(
return YoutubeHandler.help_content
except (ConnectionError, HTTPError):
return "Uh-Oh, couldn't process the request " "right now.\nPlease again later"
return "Uh-Oh, couldn't process the request right now.\nPlease again later"
reply = "Here is what I found for `" + query + "` : "