Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ ci:
style: auto fixes from pre-commit hooks
repos:
- repo: https://github.com/psf/black
rev: 23.12.0
rev: 25.1.0
hooks:
- id: black
name: Running black in all files.

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.8
rev: v0.9.6
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
name: Running ruff in all files.

- repo: https://github.com/ariebovenberg/slotscheck
rev: v0.17.1
rev: v0.19.1
hooks:
- id: slotscheck
name: Running slotscheck in all files.
exclude: "^(?!mafic/)"
additional_dependencies: [nextcord, aiohttp]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-ast
name: Check if python files are valid syntax for the ast parser
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(".."))
sys.path.append(os.path.abspath("extensions"))
from mafic import __version__ # noqa: E402
from mafic import __version__

project = "Mafic"
copyright = "2022-present, Oliver Wilkes"
Expand Down Expand Up @@ -91,7 +91,7 @@


def typehints_formatter(annotation: Any, _: Config) -> str | None: # noqa: ANN401
return aliases.get(annotation, None)
return aliases.get(annotation)


intersphinx_mapping = {
Expand Down
6 changes: 3 additions & 3 deletions mafic/__libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
from .errors import MultipleCompatibleLibraries, NoCompatibleLibraries

__all__ = (
"MISSING",
"Client",
"Connectable",
"ExponentialBackoff",
"Guild",
"GuildChannel",
"GuildVoiceStatePayload",
"MISSING",
"StageChannel",
"VoiceChannel",
"VoiceProtocol",
Expand Down Expand Up @@ -120,8 +120,8 @@

if TYPE_CHECKING:
from discord.types.voice import (
GuildVoiceState as GuildVoiceStatePayload, # noqa: TCH004
VoiceServerUpdate as VoiceServerUpdatePayload, # noqa: TCH004
GuildVoiceState as GuildVoiceStatePayload, # noqa: TC004
VoiceServerUpdate as VoiceServerUpdatePayload, # noqa: TC004
)


Expand Down
1 change: 1 addition & 0 deletions mafic/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mafic CLI tools."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions mafic/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Errors raised by Mafic."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
11 changes: 6 additions & 5 deletions mafic/events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Objects for dispatched events via the client."""

# SPDX-License-Identifier: MIT
# pyright: reportImportCycles=false
# Player import.
Expand Down Expand Up @@ -71,7 +72,7 @@ class WebSocketClosedEvent(Generic[PlayerT]):
The player that the event was dispatched from.
"""

__slots__ = ("code", "reason", "by_discord", "player")
__slots__ = ("by_discord", "code", "player", "reason")

def __init__(
self, *, payload: WebSocketClosedEventPayload, player: PlayerT
Expand Down Expand Up @@ -100,7 +101,7 @@ class TrackStartEvent(Generic[PlayerT]):
The player that the event was dispatched from.
"""

__slots__ = ("track", "player")
__slots__ = ("player", "track")

def __init__(self, *, track: Track, player: PlayerT) -> None:
self.track: Track = track
Expand All @@ -124,7 +125,7 @@ class TrackEndEvent(Generic[PlayerT]):
The player that the event was dispatched from.
"""

__slots__ = ("track", "reason", "player")
__slots__ = ("player", "reason", "track")

def __init__(
self, *, track: Track, payload: TrackEndEventPayload, player: PlayerT
Expand Down Expand Up @@ -157,7 +158,7 @@ class TrackExceptionEvent(Generic[PlayerT]):
The player that the event was dispatched from.
"""

__slots__ = ("track", "exception", "player")
__slots__ = ("exception", "player", "track")

def __init__(
self,
Expand Down Expand Up @@ -190,7 +191,7 @@ class TrackStuckEvent(Generic[PlayerT]):
The player that the event was dispatched from.
"""

__slots__ = ("track", "threshold_ms", "player")
__slots__ = ("player", "threshold_ms", "track")

def __init__(
self, *, track: Track, payload: TrackStuckEventPayload, player: PlayerT
Expand Down
25 changes: 11 additions & 14 deletions mafic/filter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Filters that can be applied to a Player."""

# SPDX-License-Identifier: MIT
# Reference to filter meanings can be found in:
# https://github.com/natanbc/lavadsp
Expand Down Expand Up @@ -601,26 +602,24 @@ class Filter:
"""

__slots__ = (
"channel_mix",
"distortion",
"equalizer",
"karaoke",
"low_pass",
"rotation",
"timescale",
"tremolo",
"vibrato",
"rotation",
"distortion",
"channel_mix",
"low_pass",
"volume",
)

def __init__(
self,
*,
equalizer: Equalizer
| list[tuple[int, float]]
| list[float]
| list[EQBand]
| None = None,
equalizer: (
Equalizer | list[tuple[int, float]] | list[float] | list[EQBand] | None
) = None,
karaoke: Karaoke | None = None,
timescale: Timescale | None = None,
tremolo: Tremolo | None = None,
Expand All @@ -644,11 +643,9 @@ def __init__(

def _convert_equalizer(
self,
equalizer: Equalizer
| list[tuple[int, float]]
| list[float]
| list[EQBand]
| None,
equalizer: (
Equalizer | list[tuple[int, float]] | list[float] | list[EQBand] | None
),
) -> Equalizer | None:
if equalizer is None:
return None
Expand Down
11 changes: 6 additions & 5 deletions mafic/ip.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Lavalink route planner API."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand All @@ -20,12 +21,12 @@
)

__all__ = (
"IPRoutePlannerType",
"IPBlockType",
"IPBlock",
"FailingAddress",
"BaseIPRoutePlannerStatus",
"BalancingIPRoutePlannerStatus",
"BaseIPRoutePlannerStatus",
"FailingAddress",
"IPBlock",
"IPBlockType",
"IPRoutePlannerType",
"NanoIPRoutePlannerStatus",
"RotatingIPRoutePlannerStatus",
"RotatingNanoIPRoutePlannerStatus",
Expand Down
11 changes: 6 additions & 5 deletions mafic/node.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Node class to represent one Lavalink instance."""

# SPDX-License-Identifier: MIT
# pyright: reportImportCycles=false
# Player import.
Expand Down Expand Up @@ -178,25 +179,25 @@ class Node(Generic[ClientT]):
"_checked_version",
"_client",
"_connect_task",
"_event_queue",
"_heartbeat",
"_host",
"_label",
"_msg_tasks",
"_players",
"_port",
"_resume_key",
"_secure",
"_timeout",
"_ready",
"_rest_uri",
"_resume_key",
"_resuming_session_id",
"_secure",
"_session_id",
"_stats",
"_timeout",
"_version",
"_ws",
"_ws_uri",
"_ws_task",
"_event_queue",
"_ws_uri",
"regions",
"shard_ids",
)
Expand Down
1 change: 1 addition & 0 deletions mafic/player.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A Player is used to connect to a channel."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions mafic/playlist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The module containing :class:`Playlist`."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions mafic/plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The Lavalink plugin system."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions mafic/pool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
r"""A module containing a :class:`NodePool`, used to manage :class:`Node`\s."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions mafic/region.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A module contains region enums for voice regions and groups."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions mafic/search_type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Represents a search type for Lavalink."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
7 changes: 4 additions & 3 deletions mafic/stats.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A module containing classes to represent node statistics."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down Expand Up @@ -31,7 +32,7 @@ class CPUStats:
The load Lavalink is using.
"""

__slots__ = ("cores", "system_load", "lavalink_load")
__slots__ = ("cores", "lavalink_load", "system_load")

def __init__(self, payload: CPU) -> None:
self.cores: int = payload["cores"]
Expand All @@ -54,7 +55,7 @@ class MemoryStats:
The amount of reservable memory for the node. Set by ``-Xmx`` for Java.
"""

__slots__ = ("free", "used", "allocated", "reservable")
__slots__ = ("allocated", "free", "reservable", "used")

def __init__(self, payload: Memory) -> None:
self.free: int = payload["free"]
Expand All @@ -76,7 +77,7 @@ class FrameStats:
The amount of frames deficit.
"""

__slots__ = ("sent", "nulled", "deficit")
__slots__ = ("deficit", "nulled", "sent")

def __init__(self, payload: FrameStatsPayload) -> None:
self.sent: int = payload["sent"]
Expand Down
1 change: 1 addition & 0 deletions mafic/strategy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The strategy system for selecting a :class:`Node` from a :class:`NodePool`."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down
3 changes: 2 additions & 1 deletion mafic/track.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The module containing :class:`Track`."""

# SPDX-License-Identifier: MIT

from __future__ import annotations
Expand Down Expand Up @@ -72,8 +73,8 @@ class Track:
"""

__slots__ = (
"author",
"artwork_url",
"author",
"id",
"identifier",
"isrc",
Expand Down
1 change: 1 addition & 0 deletions mafic/type_variables.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Type variables used in mafic."""

# SPDX-License-Identifier: MIT
# This was originally made to avoid the import cycle of
# mafic.pool -> mafic.node -> mafic.pool
Expand Down
12 changes: 6 additions & 6 deletions mafic/typings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@
from typing_extensions import NotRequired

__all__ = (
"Filters",
"CPU",
"ChannelMix",
"EQBand",
"Distortion",
"EQBand",
"Filters",
"Filters",
"FrameStats",
"Karaoke",
"LowPass",
"Memory",
"Player",
"PlaylistInfo",
"Rotation",
"Stats",
"Timescale",
"TrackInfo",
"TrackWithInfo",
"Tremolo",
"Vibrato",
"VoiceState",
"VoiceStateRequest",
"Memory",
"CPU",
"FrameStats",
"Stats",
)


Expand Down
Loading
Loading