Skip to content

Commit

Permalink
Run ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed Apr 24, 2024
1 parent 484d70e commit ceab8a9
Show file tree
Hide file tree
Showing 27 changed files with 166 additions and 127 deletions.
1 change: 0 additions & 1 deletion docs/extensions/attributetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import importlib
import inspect
import re
from enum import Enum
from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Sequence, Tuple

from docutils import nodes
Expand Down
2 changes: 1 addition & 1 deletion docs/extensions/details.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from docutils import nodes
from docutils.parsers.rst import Directive, directives, states
from docutils.parsers.rst import Directive, directives
from docutils.parsers.rst.roles import set_classes


Expand Down
4 changes: 1 addition & 3 deletions docs/extensions/exception_hierarchy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from docutils import nodes
from docutils.parsers.rst import Directive, directives, states
from docutils.parsers.rst.roles import set_classes
from sphinx.locale import _
from docutils.parsers.rst import Directive


class exception_hierarchy(nodes.General, nodes.Element):
Expand Down
4 changes: 1 addition & 3 deletions docs/extensions/prettyversion.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from docutils import nodes
from docutils.parsers.rst import Directive, directives, states
from docutils.parsers.rst.roles import set_classes
from docutils.parsers.rst import Directive
from docutils.statemachine import StringList
from sphinx.locale import _


class pretty_version_added(nodes.General, nodes.Element):
Expand Down
5 changes: 3 additions & 2 deletions examples/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import asyncio
import logging
from typing import cast
Expand All @@ -46,10 +47,10 @@ async def setup_hook(self) -> None:
await wavelink.Pool.connect(nodes=nodes, client=self, cache_capacity=100)

async def on_ready(self) -> None:
logging.info(f"Logged in: {self.user} | {self.user.id}")
logging.info("Logged in: %s | %s", self.user, self.user.id)

async def on_wavelink_node_ready(self, payload: wavelink.NodeReadyEventPayload) -> None:
logging.info(f"Wavelink Node connected: {payload.node!r} | Resumed: {payload.resumed}")
logging.info("Wavelink Node connected: %r | Resumed: %s", payload.node, payload.resumed)

async def on_wavelink_track_start(self, payload: wavelink.TrackStartEventPayload) -> None:
player: wavelink.Player | None = payload.player
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ ignore = [
"PTH123",
"E203",
"E501",
"RUF006"
]

[tool.ruff.lint.isort]
Expand All @@ -96,6 +97,7 @@ skip-magic-trailing-comma = false
line-ending = "auto"

[tool.pyright]
exclude = ["venv"]
ignore = ["test*.py", "examples/*.py", "docs/*"]
useLibraryCodeForTypes = true
typeCheckingMode = "strict"
Expand Down
4 changes: 2 additions & 2 deletions wavelink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

__title__ = "WaveLink"
__author__ = "PythonistaGuild, EvieePy"
__license__ = "MIT"
Expand All @@ -31,8 +32,7 @@
from .enums import *
from .exceptions import *
from .filters import *
from .lfu import CapacityZero as CapacityZero
from .lfu import LFUCache as LFUCache
from .lfu import CapacityZero as CapacityZero, LFUCache as LFUCache
from .node import *
from .payloads import *
from .player import Player as Player
Expand Down
3 changes: 2 additions & 1 deletion wavelink/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import wavelink


parser = argparse.ArgumentParser(prog="wavelink")
parser.add_argument("--version", action="store_true", help="Get version and debug information for wavelink.")

Expand All @@ -19,7 +20,7 @@ def get_debug_info() -> None:

info: str = f"""
wavelink: {wavelink.__version__}
Python:
- {python_info}
System:
Expand Down
7 changes: 6 additions & 1 deletion wavelink/backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""

from __future__ import annotations

import random
from collections.abc import Callable
from typing import TYPE_CHECKING


if TYPE_CHECKING:
from collections.abc import Callable


class Backoff:
Expand Down
2 changes: 2 additions & 0 deletions wavelink/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

import enum


__all__ = ("NodeStatus", "TrackSource", "DiscordVoiceCloseType", "AutoPlayMode", "QueueMode")


Expand Down
2 changes: 2 additions & 0 deletions wavelink/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
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


if TYPE_CHECKING:
from .types.response import ErrorResponse, LoadedErrorPayload

Expand Down
24 changes: 14 additions & 10 deletions wavelink/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@
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, TypedDict


if TYPE_CHECKING:
from typing_extensions import Self, Unpack

from .types.filters import ChannelMix as ChannelMixPayload
from .types.filters import Distortion as DistortionPayload
from .types.filters import Equalizer as EqualizerPayload
from .types.filters import FilterPayload
from .types.filters import Karaoke as KaraokePayload
from .types.filters import LowPass as LowPassPayload
from .types.filters import Rotation as RotationPayload
from .types.filters import Timescale as TimescalePayload
from .types.filters import Tremolo as TremoloPayload
from .types.filters import Vibrato as VibratoPayload
from .types.filters import (
ChannelMix as ChannelMixPayload,
Distortion as DistortionPayload,
Equalizer as EqualizerPayload,
FilterPayload,
Karaoke as KaraokePayload,
LowPass as LowPassPayload,
Rotation as RotationPayload,
Timescale as TimescalePayload,
Tremolo as TremoloPayload,
Vibrato as VibratoPayload,
)


__all__ = (
Expand Down
4 changes: 2 additions & 2 deletions wavelink/lfu.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from __future__ import annotations

from collections import defaultdict
Expand All @@ -30,8 +31,7 @@
from .exceptions import WavelinkException


class CapacityZero(WavelinkException):
...
class CapacityZero(WavelinkException): ...


class _MissingSentinel:
Expand Down
Loading

0 comments on commit ceab8a9

Please sign in to comment.