lint: Pre-fix places where Black will reformat incorrectly.
MODIFY
zulip_bots/zulip_bots/bots/dropbox_share/dropbox_share.py
zulip_bots/zulip_bots/bots/dropbox_share/dropbox_share.py
@@ -166,8 +166,7 @@ def dbx_write(client: Any, fn: str, content: str) -> str:
result = client.files_upload(content.encode(), fn)
msg = "Written to file: " + URL.format(name=result.name, path=result.path_lower)
except Exception:
- msg = "Incorrect file path or file already exists.\n"\
- "Usage: `write <filename> CONTENT`"
+ msg = "Incorrect file path or file already exists.\nUsage: `write <filename> CONTENT`"
return msg
@@ -178,8 +177,7 @@ def dbx_read(client: Any, fn: str) -> str:
result = client.files_download(fn)
msg = "**{}** :\n{}".format(result[0].name, result[1].text)
except Exception:
- msg = "Please provide a correct file path\n"\
- "Usage: `read <filename>` to read content of a file"
+ msg = "Please provide a correct file path\nUsage: `read <filename>` to read content of a file"
return msg
@@ -218,8 +216,7 @@ def dbx_share(client: Any, fn: str):
result = client.sharing_create_shared_link(fn)
msg = result.url
except Exception:
- msg = "Please provide a correct file name.\n"\
- "Usage: `share <filename>`"
+ msg = "Please provide a correct file name.\nUsage: `share <filename>`"
return msg

MODIFY
zulip_bots/zulip_bots/bots/dropbox_share/test_dropbox_share.py
zulip_bots/zulip_bots/bots/dropbox_share/test_dropbox_share.py
@@ -142,8 +142,7 @@ class TestDropboxBot(BotTestCase, DefaultTests):
self.verify_reply('write foo boo', bot_response)
def test_dbx_write_error(self):
- bot_response = "Incorrect file path or file already exists.\n"\
- "Usage: `write <filename> CONTENT`"
+ bot_response = "Incorrect file path or file already exists.\nUsage: `write <filename> CONTENT`"
with patch('dropbox.Dropbox.files_upload', side_effect=Exception()), \
self.mock_config_info(self.config_info):
self.verify_reply('write foo boo', bot_response)
@@ -162,8 +161,7 @@ class TestDropboxBot(BotTestCase, DefaultTests):
self.verify_reply('read foo', bot_response)
def test_dbx_search(self):
- bot_response = " - [foo](https://www.dropbox.com/home/foo)\n"\
- " - [fooboo](https://www.dropbox.com/home/fooboo)"
+ bot_response = " - [foo](https://www.dropbox.com/home/foo)\n - [fooboo](https://www.dropbox.com/home/fooboo)"
with patch('dropbox.Dropbox.files_search', side_effect=search_files), \
self.mock_config_info(self.config_info):
self.verify_reply('search foo', bot_response)
@@ -191,8 +189,7 @@ class TestDropboxBot(BotTestCase, DefaultTests):
self.verify_reply('share boo', bot_response)
def test_dbx_share_error(self):
- bot_response = "Please provide a correct file name.\n"\
- "Usage: `share <filename>`"
+ bot_response = "Please provide a correct file name.\nUsage: `share <filename>`"
with patch('dropbox.Dropbox.sharing_create_shared_link', side_effect=Exception()), \
self.mock_config_info(self.config_info):
self.verify_reply('share boo', bot_response)

MODIFY
zulip_bots/zulip_bots/bots/game_handler_bot/game_handler_bot.py
zulip_bots/zulip_bots/bots/game_handler_bot/game_handler_bot.py
@@ -51,8 +51,7 @@ class GameHandlerBotHandler(GameAdapter):
def __init__(self) -> None:
game_name = 'foo test game'
bot_name = 'game_handler_bot'
- move_help_message = '* To make your move during a game, type\n' \
- '```move <column-number>```'
+ move_help_message = '* To make your move during a game, type\n```move <column-number>```'
move_regex = r'move (\d)$'
model = MockModel
gameMessageHandler = GameHandlerBotMessageHandler

MODIFY
zulip_bots/zulip_bots/bots/game_of_fifteen/game_of_fifteen.py
zulip_bots/zulip_bots/bots/game_of_fifteen/game_of_fifteen.py
@@ -124,8 +124,7 @@ class GameOfFifteenBotHandler(GameAdapter):
def __init__(self) -> None:
game_name = 'Game of Fifteen'
bot_name = 'Game of Fifteen'
- move_help_message = '* To make your move during a game, type\n' \
- '```move <tile1> <tile2> ...```'
+ move_help_message = '* To make your move during a game, type\n```move <tile1> <tile2> ...```'
move_regex = r'move [\d{1}\s]+$'
model = GameOfFifteenModel
gameMessageHandler = GameOfFifteenMessageHandler

MODIFY
zulip_bots/zulip_bots/bots/merels/libraries/game.py
zulip_bots/zulip_bots/bots/merels/libraries/game.py
@@ -41,8 +41,7 @@ def unknown_command():
:return: A string containing info about available commands
"""
- message = "Unknown command. Available commands: " \
- "put (v,h), take (v,h), move (v,h) -> (v,h)"
+ message = "Unknown command. Available commands: put (v,h), take (v,h), move (v,h) -> (v,h)"
raise BadMoveException(message)
def beat(message, topic_name, merels_storage):

MODIFY
zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py
zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py
@@ -42,7 +42,6 @@ class TestTwitpostBot(BotTestCase, DefaultTests):
@patch('tweepy.API.update_status', return_value=api_response)
def test_tweet(self, mockedarg):
test_message = 'tweet Maybe he\'ll finally find his keys. #peterfalk'
- bot_response = 'Tweet Posted\n'\
- 'https://twitter.com/jasoncosta/status/243145735212777472'
+ bot_response = 'Tweet Posted\nhttps://twitter.com/jasoncosta/status/243145735212777472'
with self.mock_config_info(self.mock_config):
self.verify_reply(test_message, bot_response)

MODIFY
zulip_bots/zulip_bots/bots/yoda/yoda.py
zulip_bots/zulip_bots/bots/yoda/yoda.py
@@ -103,8 +103,7 @@ class YodaSpeakHandler:
logging.error(reply_message)
except ApiKeyError:
- reply_message = 'Invalid Api Key. Did you follow the instructions in the ' \
- '`readme.md` file?'
+ reply_message = 'Invalid Api Key. Did you follow the instructions in the `readme.md` file?'
logging.error(reply_message)
bot_handler.send_reply(message, reply_message)

lint: Pre-fix places where Black will reformat incorrectly.