From 9c293750cb732cfb039815a410d580b2f1a1bf2b Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 14 Feb 2024 10:39:26 -0500 Subject: [PATCH] fix(aurora): ruff fixes --- aurora/aurora.py | 33 +++++++++++---------------------- aurora/utilities/factory.py | 24 ++++++------------------ 2 files changed, 17 insertions(+), 40 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index 6ab6089..f6d9323 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -28,28 +28,17 @@ from aurora.menus.guild import Guild from aurora.menus.immune import Immune from aurora.menus.overrides import Overrides from aurora.utilities.config import config, register_config -from aurora.utilities.database import connect, create_guild_table, fetch_case, mysql_log -from aurora.utilities.factory import ( - addrole_embed, - case_factory, - changes_factory, - evidenceformat_factory, - guild_embed, - immune_embed, - message_factory, - overrides_embed, -) +from aurora.utilities.database import (connect, create_guild_table, fetch_case, + mysql_log) +from aurora.utilities.factory import (addrole_embed, case_factory, + changes_factory, evidenceformat_factory, + guild_embed, immune_embed, + message_factory, overrides_embed) from aurora.utilities.logger import logger -from aurora.utilities.utils import ( - check_moddable, - check_permissions, - convert_timedelta_to_str, - fetch_channel_dict, - fetch_user_dict, - generate_dict, - log, - send_evidenceformat, -) +from aurora.utilities.utils import (check_moddable, check_permissions, + convert_timedelta_to_str, + fetch_channel_dict, fetch_user_dict, + generate_dict, log, send_evidenceformat) class Aurora(commands.Cog): @@ -344,7 +333,7 @@ class Aurora(commands.Cog): else: parsed_time = "NULL" - if not role.id in addrole_whitelist: + if role.id not in addrole_whitelist: await interaction.response.send_message( content=error("That role isn't whitelisted!"), ephemeral=True ) diff --git a/aurora/utilities/factory.py b/aurora/utilities/factory.py index 57d1f27..c9df7e0 100644 --- a/aurora/utilities/factory.py +++ b/aurora/utilities/factory.py @@ -4,27 +4,15 @@ from datetime import datetime, timedelta from typing import Union import humanize -from discord import ( - Color, - Embed, - Guild, - Interaction, - InteractionMessage, - Member, - Role, - User, -) +from discord import (Color, Embed, Guild, Interaction, InteractionMessage, + Member, Role, User) from redbot.core import commands from redbot.core.utils.chat_formatting import bold, box, error, warning from aurora.utilities.config import config -from aurora.utilities.utils import ( - fetch_channel_dict, - fetch_user_dict, - get_bool_emoji, - get_next_case_number, - get_pagesize_str, -) +from aurora.utilities.utils import (fetch_channel_dict, fetch_user_dict, + get_bool_emoji, get_next_case_number, + get_pagesize_str) async def message_factory( @@ -53,7 +41,7 @@ async def message_factory( Returns: embed: The message embed. """ - if response is not None and not moderation_type in [ + if response is not None and moderation_type not in [ "kicked", "banned", "tempbanned",