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 #18

Open
wants to merge 2 commits into
base: main
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
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ jobs:
run: python main.py
- name: Run tests
run: pytest tests/

18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-executables-have-shebangs
- id: check-toml
Expand All @@ -11,39 +11,39 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/MarcoGorelli/auto-walrus
rev: v0.2.2
rev: 0.3.4
hooks:
- id: auto-walrus

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.270
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
- id: ruff

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies:
- tomli

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "0.11.2"
rev: "2.1.3"
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.13
rev: v0.18
hooks:
- id: validate-pyproject

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.10.1
hooks:
- id: mypy
args:
Expand Down
7 changes: 4 additions & 3 deletions cogs/docs/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ def fill_items(self) -> None:
self.add_item(self.numbered_page)
self.add_item(self.stop_pages)

async def _get_kwargs_from_page(
self, page: int
) -> Dict[str, Any,]:
async def _get_kwargs_from_page(self, page: int) -> Dict[
str,
Any,
]:
value = await disnake.utils.maybe_coroutine(self.source.format_page, self, page)
if isinstance(value, dict):
return value
Expand Down
108 changes: 61 additions & 47 deletions cogs/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,53 +38,67 @@ async def viewfeedback(
str,
] = None,
):
await send_embed(
ctx,
"",
"**Error: **distance must be an integer (an index placevalue) if no `author_from` is given!",
) if hasattr(distance, "upper") and author_from is None else await send_embed(
ctx,
"",
f'*`{distance}`*: "{data["feedback"]["message"][distance]}", submitted by **{data["feedback"]["author"][distance]}**'
if distance != 0
else f"**You can index off of the index on the left side. Type `{ctx.prefix}viewfeedback <index>`\n**\n"
+ "\n".join(
[
f"`{num}:` {data['feedback']['message'][k]}**, said by {data['feedback']['author'][k]}**"
for num, k in enumerate(range(len(data["feedback"]["message"])))
if num <= 9
]
),
a="Feedback",
i_u=ctx.author.display_avatar.url,
) if author_from is None else await send_embed(
ctx,
"",
"\n".join(
[
f"`{num}`: {data['feedback']['message'][num]}"
for num, k in enumerate(data["feedback"]["author"])
if k == author_from
]
),
a=f"Feedback from {author_from}",
i_u=ctx.author.display_avatar.url,
f=f"All these messges are from {author_from}",
) if hasattr(
author_from, "upper"
) else await send_embed(
ctx,
"",
"\n".join(
[
f"`{num}`: {data['feedback']['message'][num]}"
for num, k in enumerate(data["feedback"]["id"])
if k == author_from
]
),
a=f"Feedback from {await self.bot.fetch_user(author_from)}",
i_u=ctx.author.display_avatar.url,
f=f"All these messages are from {await self.bot.fetch_user(author_from)}",
(
await send_embed(
ctx,
"",
"**Error: **distance must be an integer (an index placevalue) if no `author_from` is given!",
)
if hasattr(distance, "upper") and author_from is None
else (
await send_embed(
ctx,
"",
(
f'*`{distance}`*: "{data["feedback"]["message"][distance]}", submitted by **{data["feedback"]["author"][distance]}**'
if distance != 0
else f"**You can index off of the index on the left side. Type `{ctx.prefix}viewfeedback <index>`\n**\n"
+ "\n".join(
[
f"`{num}:` {data['feedback']['message'][k]}**, said by {data['feedback']['author'][k]}**"
for num, k in enumerate(
range(len(data["feedback"]["message"]))
)
if num <= 9
]
)
),
a="Feedback",
i_u=ctx.author.display_avatar.url,
)
if author_from is None
else (
await send_embed(
ctx,
"",
"\n".join(
[
f"`{num}`: {data['feedback']['message'][num]}"
for num, k in enumerate(data["feedback"]["author"])
if k == author_from
]
),
a=f"Feedback from {author_from}",
i_u=ctx.author.display_avatar.url,
f=f"All these messges are from {author_from}",
)
if hasattr(author_from, "upper")
else await send_embed(
ctx,
"",
"\n".join(
[
f"`{num}`: {data['feedback']['message'][num]}"
for num, k in enumerate(data["feedback"]["id"])
if k == author_from
]
),
a=f"Feedback from {await self.bot.fetch_user(author_from)}",
i_u=ctx.author.display_avatar.url,
f=f"All these messages are from {await self.bot.fetch_user(author_from)}",
)
)
)
)

@commands.command(aliases=["dial", "call", "assistance"])
Expand Down
12 changes: 7 additions & 5 deletions cogs/games/views/blackjack.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ def visual_hand(self, cards: List[Card] = None, hide_card: bool = False) -> str:
player=player,
bar="".join("-" for _ in range(len(player))),
cards=visual_cards,
value=self.generate_card_values(
self.user_cards if not cards else self.bot_cards
)
if not hide_card
else f"{cards[0].value} + ?",
value=(
self.generate_card_values(
self.user_cards if not cards else self.bot_cards
)
if not hide_card
else f"{cards[0].value} + ?"
),
)

def generate_card_values(self, cards: List[Card]) -> int:
Expand Down
48 changes: 16 additions & 32 deletions cogs/games/views/snake.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,32 +182,25 @@ async def move_snake(self) -> None:
await self.edit_embed(self.board)

@_p1
async def _pl_1(self, _, __):
...
async def _pl_1(self, _, __): ...

@_p1
async def _pl_2(self, _, __):
...
async def _pl_2(self, _, __): ...

@_p1
async def _pl_3(self, _, __):
...
async def _pl_3(self, _, __): ...

@_p1
async def _pl_4(self, _, __):
...
async def _pl_4(self, _, __): ...

@_p1
async def _pl_5(self, _, __):
...
async def _pl_5(self, _, __): ...

@_p2
async def _pl_6(self, _, __):
...
async def _pl_6(self, _, __): ...

@_p2
async def _pl_7(self, _, __):
...
async def _pl_7(self, _, __): ...

@button(style=ButtonStyle.green, emoji=UP_ARROW, disabled=True)
async def up(self, button: Button, interaction: MessageInteraction) -> None:
Expand All @@ -219,16 +212,13 @@ async def up(self, button: Button, interaction: MessageInteraction) -> None:
await interaction.response.defer()

@_p2
async def _pl_8(self, _, __):
...
async def _pl_8(self, _, __): ...

@_p2
async def _pl_9(self, _, __):
...
async def _pl_9(self, _, __): ...

@_p3
async def _pl_10(self, _, __):
...
async def _pl_10(self, _, __): ...

@button(style=ButtonStyle.green, emoji=LEFT_ARROW, disabled=True, row=2)
async def left(self, button: Button, interaction: MessageInteraction) -> None:
Expand Down Expand Up @@ -258,28 +248,22 @@ async def right(self, button: Button, interaction: MessageInteraction) -> None:
await interaction.response.defer()

@_p3
async def _pl_11(self, _, __):
...
async def _pl_11(self, _, __): ...

@_p4
async def _pl_12(self, _, __):
...
async def _pl_12(self, _, __): ...

@_p4
async def _pl_13(self, _, __):
...
async def _pl_13(self, _, __): ...

@_p4
async def _pl_14(self, _, __):
...
async def _pl_14(self, _, __): ...

@_p4
async def _pl_15(self, _, __):
...
async def _pl_15(self, _, __): ...

@_p4
async def _pl_16(self, _, __):
...
async def _pl_16(self, _, __): ...

@button(label="Play", style=ButtonStyle.green, emoji=PLAY_BUTTON, row=4)
async def play(self, button: Button, interaction: MessageInteraction) -> None:
Expand Down
40 changes: 25 additions & 15 deletions cogs/help/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,29 @@ async def specific_command(
)
.add_field(
name=" ❯❯ Alias",
value=f"{', '.join(f'`{k}`' for k in command.aliases if command.aliases)} "
if command.aliases
else "`none`",
value=(
f"{', '.join(f'`{k}`' for k in command.aliases if command.aliases)} "
if command.aliases
else "`none`"
),
inline=False,
)
.add_field(
name=" ❯❯ Usage",
value=f"`j.{command.name} {command.signature}`"
if command.signature
else f"`j.{command.name}`",
value=(
f"`j.{command.name} {command.signature}`"
if command.signature
else f"`j.{command.name}`"
),
inline=False,
)
.add_field(
name=" ❯❯ Description",
value=f"{get_help(command.name)}"
if get_help(command.name)
else "Currently no help!",
value=(
f"{get_help(command.name)}"
if get_help(command.name)
else "Currently no help!"
),
inline=False,
)
.set_author(name="Help", icon_url=ctx.author.display_avatar.url)
Expand Down Expand Up @@ -152,15 +158,19 @@ async def no_command(self, ctx: Context) -> disnake.Embed:
)
.add_field(
name="\u200b",
value="\n".join(commands[i] for i in range(0, len(commands), 2))
if commands
else "-",
value=(
"\n".join(commands[i] for i in range(0, len(commands), 2))
if commands
else "-"
),
)
.add_field(
name="\u200b",
value="\n".join(commands[i] for i in range(1, len(commands), 2))
if commands
else "-",
value=(
"\n".join(commands[i] for i in range(1, len(commands), 2))
if commands
else "-"
),
)
)

Expand Down
Loading
Loading