Skip to content

Commit a22a9de

Browse files
committed
Fix line-too-long issues
1 parent 1df2188 commit a22a9de

3 files changed

Lines changed: 28 additions & 14 deletions

File tree

wavelink/node.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,10 @@ async def connect(
807807
logger.error("Failed to authenticate %r on Lavalink with the provided password.", node)
808808
except NodeException:
809809
logger.error(
810-
"Failed to connect to %r. Check that your Lavalink major version is '4' and that you are trying to connect to Lavalink on the correct port.",
810+
(
811+
"Failed to connect to %r. Check that your Lavalink major version is"
812+
" '4' and that you are trying to connect to Lavalink on the correct port."
813+
),
811814
node,
812815
)
813816
else:
@@ -837,7 +840,10 @@ async def reconnect(cls) -> dict[str, Node]:
837840
logger.error("Failed to authenticate %r on Lavalink with the provided password.", node)
838841
except NodeException:
839842
logger.error(
840-
"Failed to connect to %r. Check that your Lavalink major version is '4' and that you are trying to connect to Lavalink on the correct port.",
843+
(
844+
"Failed to connect to %r. Check that your Lavalink major version "
845+
"is '4' and that you are trying to connect to Lavalink on the correct port."
846+
),
841847
node,
842848
)
843849

@@ -985,7 +991,7 @@ async def fetch_tracks(cls, query: str, /, *, node: Node | None = None) -> list[
985991
return []
986992

987993
@classmethod
988-
def cache(cls, capacity: int | None | bool = None) -> None:
994+
def cache(cls, capacity: int | bool | None = None) -> None:
989995
if capacity in (None, False) or capacity <= 0:
990996
cls.__cache = None
991997
return

wavelink/player.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Player(discord.VoiceProtocol):
102102
The queue associated with this player.
103103
auto_queue: :class:`~wavelink.Queue`
104104
The auto_queue associated with this player. This queue holds tracks that are recommended by the AutoPlay feature.
105-
"""
105+
""" # noqa: E501 # documentation
106106

107107
channel: VocalGuildChannel
108108

@@ -278,15 +278,11 @@ async def _auto_play_event(self, payload: TrackEndEventPayload) -> None:
278278
self._error_count = 0
279279

280280
if self.node.status is not NodeStatus.CONNECTED:
281-
logger.warning(
282-
'"Unable to use AutoPlay on Player for Guild "%s" due to disconnected Node.', str(self.guild)
283-
)
281+
logger.warning('"Unable to use AutoPlay on Player for Guild "%s" due to disconnected Node.', self.guild)
284282
return
285283

286284
if not isinstance(self.queue, Queue) or not isinstance(self.auto_queue, Queue): # type: ignore
287-
logger.warning(
288-
'"Unable to use AutoPlay on Player for Guild "%s" due to unsupported Queue.', str(self.guild)
289-
)
285+
logger.warning('"Unable to use AutoPlay on Player for Guild "%s" due to unsupported Queue.', self.guild)
290286
self._inactivity_start()
291287
return
292288

wavelink/websocket.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ async def connect(self) -> None:
102102
self.keep_alive_task.cancel()
103103
except Exception as e:
104104
logger.debug(
105-
"Failed to cancel websocket keep alive while connecting. This is most likely not a problem and will not affect websocket connection: '%s'",
105+
(
106+
"Failed to cancel websocket keep alive while connecting. "
107+
"This is most likely not a problem and will not affect websocket connection: '%s'"
108+
),
106109
e,
107110
)
108111

@@ -124,7 +127,10 @@ async def connect(self) -> None:
124127
raise NodeException from e
125128
else:
126129
logger.warning(
127-
'An unexpected error occurred while connecting %r to Lavalink: "%s"\nIf this error persists or wavelink is unable to reconnect, please see: %s',
130+
(
131+
'An unexpected error occurred while connecting %r to Lavalink: "%s"\n'
132+
"If this error persists or wavelink is unable to reconnect, please see: %s"
133+
),
128134
self.node,
129135
e,
130136
github,
@@ -136,7 +142,10 @@ async def connect(self) -> None:
136142

137143
if retries == 0:
138144
logger.warning(
139-
'%r was unable to successfully connect/reconnect to Lavalink after "%s" connection attempt. This Node has exhausted the retry count.',
145+
(
146+
'%r was unable to successfully connect/reconnect to Lavalink after "%s" connection attempt. '
147+
"This Node has exhausted the retry count."
148+
),
140149
self.node,
141150
retries + 1,
142151
)
@@ -234,7 +243,10 @@ async def keep_alive(self) -> None:
234243
)
235244

236245
LOGGER_TRACK.error(
237-
"A Lavalink TrackException was received on %r for player %r: %s, caused by: %s, with severity: %s",
246+
(
247+
"A Lavalink TrackException was received on %r for "
248+
"player %r: %s, caused by: %s, with severity: %s"
249+
),
238250
self.node,
239251
player,
240252
exception.get("message", ""),

0 commit comments

Comments
 (0)