Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
TimJentzsch committed Aug 24, 2022
1 parent fa822c0 commit ef2feba
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
4 changes: 3 additions & 1 deletion bubbles/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 4 additions & 1 deletion bubbles/commands/periodic/rule_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions bubbles/commands/yell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions bubbles/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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."""
Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion bubbles/tl_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def job(self):
except Exception as e:
# Catch all errors to make sure the bot doesn't crash
# See <https://stackoverflow.com/a/62952274>
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:
Expand Down

0 comments on commit ef2feba

Please sign in to comment.