Reformat entire project with ruff instead of black

This commit is contained in:
Rapptz
2025-08-18 20:15:44 -04:00
parent 3ef6272e07
commit 44a44e938f
88 changed files with 485 additions and 730 deletions

View File

@ -21,6 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
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 (
@ -405,8 +406,7 @@ class ActionRow(Item[V]):
max_values: int = ...,
disabled: bool = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, SelectT]:
...
) -> SelectCallbackDecorator[S, SelectT]: ...
@overload
def select(
@ -422,8 +422,7 @@ class ActionRow(Item[V]):
disabled: bool = ...,
default_values: Sequence[ValidDefaultValues] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, UserSelectT]:
...
) -> SelectCallbackDecorator[S, UserSelectT]: ...
@overload
def select(
@ -439,8 +438,7 @@ class ActionRow(Item[V]):
disabled: bool = ...,
default_values: Sequence[ValidDefaultValues] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, RoleSelectT]:
...
) -> SelectCallbackDecorator[S, RoleSelectT]: ...
@overload
def select(
@ -456,8 +454,7 @@ class ActionRow(Item[V]):
disabled: bool = ...,
default_values: Sequence[ValidDefaultValues] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, ChannelSelectT]:
...
) -> SelectCallbackDecorator[S, ChannelSelectT]: ...
@overload
def select(
@ -473,8 +470,7 @@ class ActionRow(Item[V]):
disabled: bool = ...,
default_values: Sequence[ValidDefaultValues] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, MentionableSelectT]:
...
) -> SelectCallbackDecorator[S, MentionableSelectT]: ...
def select(
self,

View File

@ -21,6 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
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, List, Literal, Optional, TypeVar, Union

View File

@ -176,7 +176,7 @@ class Modal(View):
else:
item = find(lambda i: getattr(i, 'custom_id', None) == component['custom_id'], self.walk_children()) # type: ignore
if item is None:
_log.debug("Modal interaction referencing unknown item custom_id %s. Discarding", component['custom_id'])
_log.debug('Modal interaction referencing unknown item custom_id %s. Discarding', component['custom_id'])
continue
item._refresh_state(interaction, component) # type: ignore

View File

@ -21,6 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
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, Dict, Generator, List, Literal, Optional, TypeVar, Union, ClassVar

View File

@ -361,11 +361,12 @@ class BaseSelect(Item[V]):
payload: List[PossibleValue]
try:
resolved = Namespace._get_resolved_items(
interaction, data['resolved'] # pyright: ignore[reportTypedDictNotRequiredAccess]
interaction,
data['resolved'], # pyright: ignore[reportTypedDictNotRequiredAccess]
)
payload = list(resolved.values())
except KeyError:
payload = data.get("values", []) # type: ignore
payload = data.get('values', []) # type: ignore
self._values = values[self.custom_id] = payload
selected_values.set(values)
@ -985,8 +986,7 @@ def select(
disabled: bool = ...,
row: Optional[int] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, SelectT]:
...
) -> SelectCallbackDecorator[S, SelectT]: ...
@overload
@ -1003,8 +1003,7 @@ def select(
default_values: Sequence[ValidDefaultValues] = ...,
row: Optional[int] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, UserSelectT]:
...
) -> SelectCallbackDecorator[S, UserSelectT]: ...
@overload
@ -1021,8 +1020,7 @@ def select(
default_values: Sequence[ValidDefaultValues] = ...,
row: Optional[int] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, RoleSelectT]:
...
) -> SelectCallbackDecorator[S, RoleSelectT]: ...
@overload
@ -1039,8 +1037,7 @@ def select(
default_values: Sequence[ValidDefaultValues] = ...,
row: Optional[int] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, ChannelSelectT]:
...
) -> SelectCallbackDecorator[S, ChannelSelectT]: ...
@overload
@ -1057,8 +1054,7 @@ def select(
default_values: Sequence[ValidDefaultValues] = ...,
row: Optional[int] = ...,
id: Optional[int] = ...,
) -> SelectCallbackDecorator[S, MentionableSelectT]:
...
) -> SelectCallbackDecorator[S, MentionableSelectT]: ...
def select(

View File

@ -21,6 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
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, Literal, Optional, TypeVar

View File

@ -689,8 +689,7 @@ class View(BaseView):
if TYPE_CHECKING:
@classmethod
def from_message(cls, message: Message, /, *, timeout: Optional[float] = 180.0) -> View:
...
def from_message(cls, message: Message, /, *, timeout: Optional[float] = 180.0) -> View: ...
def __init_subclass__(cls) -> None:
super().__init_subclass__()
@ -783,8 +782,7 @@ class LayoutView(BaseView):
if TYPE_CHECKING:
@classmethod
def from_message(cls, message: Message, /, *, timeout: Optional[float] = 180.0) -> LayoutView:
...
def from_message(cls, message: Message, /, *, timeout: Optional[float] = 180.0) -> LayoutView: ...
def __init__(self, *, timeout: Optional[float] = 180.0) -> None:
super().__init__(timeout=timeout)
@ -1046,7 +1044,7 @@ class ViewStore:
) -> None:
modal = self._modals.get(custom_id)
if modal is None:
_log.debug("Modal interaction referencing unknown custom_id %s. Discarding", custom_id)
_log.debug('Modal interaction referencing unknown custom_id %s. Discarding', custom_id)
return
self.add_task(modal._dispatch_submit(interaction, components))