From ef2febad7915c0224fd06248525fdc7662a6d62f Mon Sep 17 00:00:00 2001 From: Tim Jentzsch Date: Wed, 24 Aug 2022 11:44:23 +0200 Subject: [PATCH] Fix formatting --- bubbles/commands/deploy.py | 4 +++- bubbles/commands/periodic/rule_monitoring.py | 5 ++++- bubbles/commands/yell.py | 5 +---- bubbles/main.py | 5 +---- .../commands/periodic/test_transcription_check_ping.py | 9 +++------ bubbles/tl_commands.py | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/bubbles/commands/deploy.py b/bubbles/commands/deploy.py index eacbb54..4bc8161 100644 --- a/bubbles/commands/deploy.py +++ b/bubbles/commands/deploy.py @@ -27,7 +27,9 @@ def _deploy_service(service: str, payload: dict) -> None: def check_for_new_version() -> dict: StatusMessage.add_new_context_step("Checking for new release...") - output = subprocess.check_output(shlex.split(f"{PYTHON_VERSION} {service}.pyz --version")) + output = subprocess.check_output( + shlex.split(f"{PYTHON_VERSION} {service}.pyz --version") + ) # starting from something like b'BubblesV2, version ?????\n' current_version = output.decode().strip().split(", ")[-1].split()[-1] github_response = requests.get( diff --git a/bubbles/commands/periodic/rule_monitoring.py b/bubbles/commands/periodic/rule_monitoring.py index 7de7ee8..58fcfe2 100644 --- a/bubbles/commands/periodic/rule_monitoring.py +++ b/bubbles/commands/periodic/rule_monitoring.py @@ -6,7 +6,10 @@ from praw.models import Rule -from bubbles.commands.periodic import RULE_MONITORING_CHANNEL_ID, RULE_MONITORING_DATA_PATH +from bubbles.commands.periodic import ( + RULE_MONITORING_CHANNEL_ID, + RULE_MONITORING_DATA_PATH, +) from bubbles.config import reddit, app # Newly-added subreddits that don't have their rules tracked yet diff --git a/bubbles/commands/yell.py b/bubbles/commands/yell.py index 34bbc98..a73e1eb 100644 --- a/bubbles/commands/yell.py +++ b/bubbles/commands/yell.py @@ -21,10 +21,7 @@ compiled_pattern = re.compile(raw_pattern, re.VERBOSE | re.MULTILINE | re.IGNORECASE) -idk = ( - "I KNOW YOU'RE HAVING TROUBLE BUT " - "I DON'T KNOW WHAT'S GOING ON EITHER." -) +idk = "I KNOW YOU'RE HAVING TROUBLE BUT " "I DON'T KNOW WHAT'S GOING ON EITHER." def yell(payload: dict) -> None: diff --git a/bubbles/main.py b/bubbles/main.py index 5700c34..14d57f5 100644 --- a/bubbles/main.py +++ b/bubbles/main.py @@ -93,10 +93,7 @@ def reaction_added(ack, payload): ) @click.pass_context @click.option( - "-c", - "--command", - "command", - help="Try and run a Bubbles command by name.", + "-c", "--command", "command", help="Try and run a Bubbles command by name.", ) @click.option( "-i", diff --git a/bubbles/test/commands/periodic/test_transcription_check_ping.py b/bubbles/test/commands/periodic/test_transcription_check_ping.py index d862178..b95f279 100644 --- a/bubbles/test/commands/periodic/test_transcription_check_ping.py +++ b/bubbles/test/commands/periodic/test_transcription_check_ping.py @@ -78,8 +78,7 @@ @pytest.mark.parametrize( - "message,expected", - [({"user": "ADDBAS9A"}, True), ({"user": "UEEMDNC0K"}, False)], + "message,expected", [({"user": "ADDBAS9A"}, True), ({"user": "UEEMDNC0K"}, False)], ) def test_is_check_message(message: Dict, expected: bool) -> None: """Test whether checks are detected correctly.""" @@ -93,8 +92,7 @@ def test_is_check_message(message: Dict, expected: bool) -> None: @pytest.mark.parametrize( - "message,expected", - [(EXAMPLE_OLD_CHECK, True), (EXAMPLE_NEW_CHECK, False)], + "message,expected", [(EXAMPLE_OLD_CHECK, True), (EXAMPLE_NEW_CHECK, False)], ) def test_is_old_check(message: Dict, expected: bool) -> None: """Test whether old checks are detected correctly.""" @@ -157,8 +155,7 @@ def test_get_check_status(message: Dict, expected: Tuple[CheckStatus, str]) -> N @pytest.mark.parametrize( - "message", - [EXAMPLE_OLD_CHECK, EXAMPLE_NEW_CHECK], + "message", [EXAMPLE_OLD_CHECK, EXAMPLE_NEW_CHECK], ) def test_get_check_data(message: Dict) -> None: """Test whether the check data is extracted correctly.""" diff --git a/bubbles/tl_commands.py b/bubbles/tl_commands.py index b6fb407..c0d84ec 100644 --- a/bubbles/tl_commands.py +++ b/bubbles/tl_commands.py @@ -97,7 +97,7 @@ def job(self): except Exception as e: # Catch all errors to make sure the bot doesn't crash # See - tb_str = ''.join(traceback.format_exception(None, e, e.__traceback__)) + tb_str = "".join(traceback.format_exception(None, e, e.__traceback__)) logging.error(f"Failed to check for rule changes: {e}\n{tb_str}") class Meta: