Skip to content

Commit 2078972

Browse files
committed
Fix new reported errors from Ruff version bump
1 parent 2783e70 commit 2078972

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

alembic/env.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030

3131
config.set_main_option("sqlalchemy.url", build_db_uri())
3232

33+
3334
def do_run_migrations(connection: Connection) -> None:
3435
"""Run migrations."""
3536
context.configure(connection=connection, target_metadata=target_metadata)
3637

3738
with context.begin_transaction():
3839
context.run_migrations()
3940

41+
4042
async def run_async_migrations() -> None:
4143
"""Run migrations asynchronously using the asyncpg driver."""
4244
connectable = async_engine_from_config(
@@ -50,6 +52,7 @@ async def run_async_migrations() -> None:
5052

5153
await connectable.dispose()
5254

55+
5356
def run_migrations_offline() -> None:
5457
"""
5558
Run migrations in 'offline' mode.

metricity/database.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
log = logging.getLogger(__name__)
1414

15+
1516
def build_db_uri() -> str:
1617
"""Build the database uri from the config."""
1718
if DatabaseConfig.uri:
@@ -27,9 +28,11 @@ def build_db_uri() -> str:
2728
f"@{DatabaseConfig.host}:{DatabaseConfig.port}/{DatabaseConfig.database}"
2829
)
2930

31+
3032
engine: AsyncEngine = create_async_engine(build_db_uri(), echo=DatabaseConfig.log_queries)
3133
async_session = async_sessionmaker(engine, expire_on_commit=False)
3234

35+
3336
class TZDateTime(TypeDecorator):
3437
"""
3538
A db type that supports the use of aware datetimes in user-land.

metricity/exts/event_listeners/guild_listeners.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
log = logging.get_logger(__name__)
1818

19+
1920
class GuildListeners(commands.Cog):
2021
"""Listen for guild (and guild channel) events and sync them to the database."""
2122

metricity/exts/event_listeners/member_listeners.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ async def on_member_update(self, _before: discord.Member, member: discord.Member
125125
await sess.commit()
126126

127127

128-
129128
async def setup(bot: Bot) -> None:
130129
"""Load the MemberListeners cog."""
131130
await bot.add_cog(MemberListeners(bot))

0 commit comments

Comments
 (0)