Skip to content

Commit

Permalink
Switch to isort for black compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed May 12, 2024
1 parent 083858d commit 871f33a
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ repos:
hooks:
- id: pyupgrade
args: [--py39-plus, --keep-runtime-typing]
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: reorder-python-imports
args: [--py39-plus, --add-import, 'from __future__ import annotations']
- id: isort
args: [--profile, black, --add-import, from __future__ import annotations, --force-single-line-imports]
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
Expand Down
1 change: 1 addition & 0 deletions common/constants/actions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains user actions"""

from __future__ import annotations

IDLE = 0
Expand Down
1 change: 0 additions & 1 deletion common/log/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

from typing_extensions import TypeAlias


LOG_CONTEXT: ContextVar[Optional[dict[str, Any]]] = ContextVar(
"LOG_CONTEXT",
default=None,
Expand Down
1 change: 1 addition & 0 deletions constants/dataTypes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Bancho packets data types"""

from __future__ import annotations

BYTE = 0
Expand Down
1 change: 1 addition & 0 deletions constants/packetIDs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contain server and client packet IDs"""

from __future__ import annotations

client_changeAction = 0
Expand Down
2 changes: 1 addition & 1 deletion constants/serverPackets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Contains functions used to write specific server packets to byte streams """

from __future__ import annotations

from typing import Optional
Expand All @@ -15,7 +16,6 @@
from objects import osuToken
from objects import tokenList


# TODO: any packet using async/await should likely
# be refactored to accept the data as a parameter
# such that this can be just be a serialization layer
Expand Down
1 change: 1 addition & 0 deletions irc/ircserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Most of the reference code from miniircd was used for the low-level logic.
The high-level code has been rewritten to make it compatible with bancho-service.
"""

# NOTE(2023-08-10): this is currently deprecated within akatsuki and is not functional
# here because we may use it in the future - perhaps for deletion eventually.
from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion objects/dbPool.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from typing import cast
from typing import Optional
from typing import cast

import aiomysql

Expand Down
5 changes: 3 additions & 2 deletions objects/glob.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Global objects and variables"""

from __future__ import annotations

import time
from typing import Optional
from typing import TYPE_CHECKING
from typing import Optional

import httpx
from amplitude import Amplitude
Expand All @@ -14,9 +15,9 @@
if TYPE_CHECKING:
from redis.asyncio import Redis

from objects.dbPool import DBPool
from irc.ircserver import Server as IRCServer
from objects.banchoConfig import banchoConfig
from objects.dbPool import DBPool


BOT_NAME = "Aika"
Expand Down
1 change: 0 additions & 1 deletion workers/crons/reset_all_tokens_spam_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import sys


sys.path.insert(1, os.path.join(sys.path[0], "../.."))

import lifecycle
Expand Down
2 changes: 1 addition & 1 deletion workers/crons/timeout_inactive_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
from common import exception_handling
from common.log import logger
from common.log import logging_config
from constants import CHATBOT_USER_ID
from events import logoutEvent
from objects import osuToken
from objects.redisLock import redisLock
from constants import CHATBOT_USER_ID

OSU_MAX_PING_INTERVAL = 300 # seconds

Expand Down
1 change: 0 additions & 1 deletion workers/daemons/consume_pubsub_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import sys


sys.path.insert(1, os.path.join(sys.path[0], "../.."))

import lifecycle
Expand Down

1 comment on commit 871f33a

@cmyui
Copy link
Member Author

@cmyui cmyui commented on 871f33a May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.