Skip to content

Commit

Permalink
chore(pre-commit): pre-commit autoupdate (Pycord-Development#2336)
Browse files Browse the repository at this point in the history
* chore(pre-commit): pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)

* style(pre-commit): auto fixes from pre-commit.com hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Feb 19, 2024
1 parent 8a7ea47 commit e07d0d9
Show file tree
Hide file tree
Showing 57 changed files with 163 additions and 187 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.1.1
hooks:
- id: black
args: [--safe, --quiet]
Expand Down
1 change: 1 addition & 0 deletions discord/_typed_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

import sys

# PEP 655 Required and NotRequired were added in python 3.11. This file is simply a
Expand Down
1 change: 1 addition & 0 deletions discord/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import datetime
Expand Down
39 changes: 14 additions & 25 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ class GuildChannel:

def __init__(
self, *, state: ConnectionState, guild: Guild, data: dict[str, Any]
):
...
): ...

def __str__(self) -> str:
return self.name
Expand Down Expand Up @@ -526,9 +525,9 @@ async def _edit(
"default_reaction_emoji must be of type: Emoji | int | str"
)

options[
"default_reaction_emoji"
] = default_reaction_emoji._to_forum_reaction_payload()
options["default_reaction_emoji"] = (
default_reaction_emoji._to_forum_reaction_payload()
)

if options:
return await self._state.http.edit_channel(
Expand Down Expand Up @@ -853,8 +852,7 @@ async def set_permissions(
*,
overwrite: PermissionOverwrite | None = ...,
reason: str | None = ...,
) -> None:
...
) -> None: ...

@overload
async def set_permissions(
Expand All @@ -863,8 +861,7 @@ async def set_permissions(
*,
reason: str | None = ...,
**permissions: bool,
) -> None:
...
) -> None: ...

async def set_permissions(
self, target, *, overwrite=MISSING, reason=None, **permissions
Expand Down Expand Up @@ -1033,8 +1030,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str | None = MISSING,
) -> None:
...
) -> None: ...

@overload
async def move(
Expand All @@ -1045,8 +1041,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str = MISSING,
) -> None:
...
) -> None: ...

@overload
async def move(
Expand All @@ -1057,8 +1052,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str = MISSING,
) -> None:
...
) -> None: ...

@overload
async def move(
Expand All @@ -1069,8 +1063,7 @@ async def move(
category: Snowflake | None = MISSING,
sync_permissions: bool = MISSING,
reason: str = MISSING,
) -> None:
...
) -> None: ...

async def move(self, **kwargs) -> None:
"""|coro|
Expand Down Expand Up @@ -1359,8 +1352,7 @@ async def send(
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

@overload
async def send(
Expand All @@ -1379,8 +1371,7 @@ async def send(
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

@overload
async def send(
Expand All @@ -1399,8 +1390,7 @@ async def send(
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

@overload
async def send(
Expand All @@ -1419,8 +1409,7 @@ async def send(
view: View = ...,
suppress: bool = ...,
silent: bool = ...,
) -> Message:
...
) -> Message: ...

async def send(
self,
Expand Down
6 changes: 2 additions & 4 deletions discord/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,13 +843,11 @@ def __repr__(self) -> str:


@overload
def create_activity(data: ActivityPayload) -> ActivityTypes:
...
def create_activity(data: ActivityPayload) -> ActivityTypes: ...


@overload
def create_activity(data: None) -> None:
...
def create_activity(data: None) -> None: ...


def create_activity(data: ActivityPayload | None) -> ActivityTypes | None:
Expand Down
6 changes: 2 additions & 4 deletions discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,9 @@ def __repr__(self) -> str:

if TYPE_CHECKING:

def __getattr__(self, item: str) -> Any:
...
def __getattr__(self, item: str) -> Any: ...

def __setattr__(self, key: str, value: Any) -> Any:
...
def __setattr__(self, key: str, value: Any) -> Any: ...


Transformer = Callable[["AuditLogEntry", Any], Any]
Expand Down
9 changes: 3 additions & 6 deletions discord/backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,13 @@ def __init__(self, base: int = 1, *, integral: T = False):
self._randfunc: Callable[..., int | float] = rand.randrange if integral else rand.uniform # type: ignore

@overload
def delay(self: ExponentialBackoff[Literal[False]]) -> float:
...
def delay(self: ExponentialBackoff[Literal[False]]) -> float: ...

@overload
def delay(self: ExponentialBackoff[Literal[True]]) -> int:
...
def delay(self: ExponentialBackoff[Literal[True]]) -> int: ...

@overload
def delay(self: ExponentialBackoff[bool]) -> int | float:
...
def delay(self: ExponentialBackoff[bool]) -> int | float: ...

def delay(self) -> int | float:
"""Compute the next delay
Expand Down
3 changes: 1 addition & 2 deletions discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,7 @@ async def invoke_application_command(self, ctx: ApplicationContext) -> None:

@property
@abstractmethod
def _bot(self) -> Bot | AutoShardedBot:
...
def _bot(self) -> Bot | AutoShardedBot: ...


class BotBase(ApplicationCommandMixin, CogMixin, ABC):
Expand Down
30 changes: 10 additions & 20 deletions discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,10 @@ async def edit(
default_thread_slowmode_delay: int = ...,
type: ChannelType = ...,
overwrites: Mapping[Role | Member | Snowflake, PermissionOverwrite] = ...,
) -> TextChannel | None:
...
) -> TextChannel | None: ...

@overload
async def edit(self) -> TextChannel | None:
...
async def edit(self) -> TextChannel | None: ...

async def edit(self, *, reason=None, **options):
"""|coro|
Expand Down Expand Up @@ -1090,12 +1088,10 @@ async def edit(
available_tags: list[ForumTag] = ...,
require_tag: bool = ...,
overwrites: Mapping[Role | Member | Snowflake, PermissionOverwrite] = ...,
) -> ForumChannel | None:
...
) -> ForumChannel | None: ...

@overload
async def edit(self) -> ForumChannel | None:
...
async def edit(self) -> ForumChannel | None: ...

async def edit(self, *, reason=None, **options):
"""|coro|
Expand Down Expand Up @@ -1834,12 +1830,10 @@ async def edit(
video_quality_mode: VideoQualityMode = ...,
slowmode_delay: int = ...,
reason: str | None = ...,
) -> VoiceChannel | None:
...
) -> VoiceChannel | None: ...

@overload
async def edit(self) -> VoiceChannel | None:
...
async def edit(self) -> VoiceChannel | None: ...

async def edit(self, *, reason=None, **options):
"""|coro|
Expand Down Expand Up @@ -2459,12 +2453,10 @@ async def edit(
rtc_region: VoiceRegion | None = ...,
video_quality_mode: VideoQualityMode = ...,
reason: str | None = ...,
) -> StageChannel | None:
...
) -> StageChannel | None: ...

@overload
async def edit(self) -> StageChannel | None:
...
async def edit(self) -> StageChannel | None: ...

async def edit(self, *, reason=None, **options):
"""|coro|
Expand Down Expand Up @@ -2638,12 +2630,10 @@ async def edit(
nsfw: bool = ...,
overwrites: Mapping[Role | Member, PermissionOverwrite] = ...,
reason: str | None = ...,
) -> CategoryChannel | None:
...
) -> CategoryChannel | None: ...

@overload
async def edit(self) -> CategoryChannel | None:
...
async def edit(self) -> CategoryChannel | None: ...

async def edit(self, *, reason=None, **options):
"""|coro|
Expand Down
6 changes: 3 additions & 3 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ def __init__(
self.loop: asyncio.AbstractEventLoop = (
asyncio.get_event_loop() if loop is None else loop
)
self._listeners: dict[
str, list[tuple[asyncio.Future, Callable[..., bool]]]
] = {}
self._listeners: dict[str, list[tuple[asyncio.Future, Callable[..., bool]]]] = (
{}
)
self.shard_id: int | None = options.get("shard_id")
self.shard_count: int | None = options.get("shard_count")

Expand Down
19 changes: 8 additions & 11 deletions discord/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import importlib
Expand Down Expand Up @@ -201,9 +202,9 @@ def __new__(cls: type[CogMeta], *args: Any, **kwargs: Any) -> CogMeta:
commands[f"app_{elem}"] = value.slash_variant
commands[elem] = value
for cmd in getattr(value, "subcommands", []):
commands[
f"ext_{cmd.ext_variant.qualified_name}"
] = cmd.ext_variant
commands[f"ext_{cmd.ext_variant.qualified_name}"] = (
cmd.ext_variant
)

if inspect.iscoroutinefunction(value):
try:
Expand Down Expand Up @@ -808,8 +809,7 @@ def load_extension(
*,
package: str | None = None,
recursive: bool = False,
) -> list[str]:
...
) -> list[str]: ...

@overload
def load_extension(
Expand All @@ -819,8 +819,7 @@ def load_extension(
package: str | None = None,
recursive: bool = False,
store: bool = False,
) -> dict[str, Exception | bool] | list[str] | None:
...
) -> dict[str, Exception | bool] | list[str] | None: ...

def load_extension(
self, name, *, package=None, recursive=False, store=False
Expand Down Expand Up @@ -941,8 +940,7 @@ def load_extensions(
*names: str,
package: str | None = None,
recursive: bool = False,
) -> list[str]:
...
) -> list[str]: ...

@overload
def load_extensions(
Expand All @@ -951,8 +949,7 @@ def load_extensions(
package: str | None = None,
recursive: bool = False,
store: bool = False,
) -> dict[str, Exception | bool] | list[str] | None:
...
) -> dict[str, Exception | bool] | list[str] | None: ...

def load_extensions(
self, *names, package=None, recursive=False, store=False
Expand Down
1 change: 1 addition & 0 deletions discord/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import colorsys
Expand Down
1 change: 1 addition & 0 deletions discord/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, Any, TypeVar
Expand Down
Loading

0 comments on commit e07d0d9

Please sign in to comment.