Skip to content

Commit

Permalink
Merge pull request #1395 from python-discord/dependabot/pip/ruff-0.1.5
Browse files Browse the repository at this point in the history
Bump ruff from 0.1.4 to 0.1.5
  • Loading branch information
ChrisLovering authored Nov 13, 2023
2 parents 79556e5 + a6a8f8e commit eed1a17
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 46 deletions.
2 changes: 1 addition & 1 deletion bot/exts/core/internal_eval/_internal_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async def eval(self, ctx: commands.Context, *, code: str) -> None:
code = "\n".join(block.group("code") for block in blocks)
else:
match = match[0] if len(blocks) == 0 else blocks[0]
code, block, lang, delim = match.group("code", "block", "lang", "delim")
code, _, _, _ = match.group("code", "block", "lang", "delim")

else:
code = RAW_CODE_REGEX.fullmatch(code).group("code")
Expand Down
4 changes: 2 additions & 2 deletions bot/exts/fun/snakes/_snakes_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async def _get_snek(self, name: str) -> dict[str, Any]:

for image in snake_info["images"]:
# Images come in the format of `File:filename.extension`
file, sep, filename = image["title"].partition(":")
_, _, filename = image["title"].partition(":")
filename = filename.replace(" ", "%20") # Wikipedia returns good data!

if not filename.startswith("Map"):
Expand Down Expand Up @@ -421,7 +421,7 @@ def predicate(reaction: Reaction, user: Member) -> bool:

# Validate the answer
try:
reaction, user = await ctx.bot.wait_for("reaction_add", timeout=45.0, check=predicate)
reaction, _ = await ctx.bot.wait_for("reaction_add", timeout=45.0, check=predicate)
except TimeoutError:
await ctx.send(f"You took too long. The correct answer was **{options[answer]}**.")
await message.clear_reactions()
Expand Down
2 changes: 1 addition & 1 deletion bot/exts/fun/tic_tac_toe.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def confirm_check(reaction: discord.Reaction, user: discord.User) -> bool:
)

try:
reaction, user = await self.ctx.bot.wait_for(
reaction, _ = await self.ctx.bot.wait_for(
"reaction_add",
timeout=60.0,
check=confirm_check
Expand Down
4 changes: 2 additions & 2 deletions bot/exts/utilities/colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _rgb_to_name(self, rgb: tuple[int, int, int]) -> str | None:
"""Convert RGB values to a fuzzy matched name."""
input_hex_colour = self._rgb_to_hex(rgb)
try:
match, certainty, _ = rapidfuzz.process.extractOne(
match, _, _ = rapidfuzz.process.extractOne(
query=input_hex_colour,
choices=self.colour_mapping.values(),
score_cutoff=80
Expand All @@ -249,7 +249,7 @@ def _rgb_to_name(self, rgb: tuple[int, int, int]) -> str | None:
def match_colour_name(self, ctx: commands.Context, input_colour_name: str) -> str | None:
"""Convert a colour name to HEX code."""
try:
match, certainty, _ = rapidfuzz.process.extractOne(
match, _, _ = rapidfuzz.process.extractOne(
query=input_colour_name,
choices=self.colour_mapping.keys(),
score_cutoff=80
Expand Down
6 changes: 3 additions & 3 deletions bot/utils/halloween/spookifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def pentagram(im: Image.Image) -> Image.Image:

def bat(im: Image.Image) -> Image.Image:
"""
Adds a bat silhoutte to the image.
Adds a bat silhouette to the image.
The bat silhoutte is of a size at least one-fifths that of the original image and may be rotated
The bat silhouette is of a size at least one-fifths that of the original image and may be rotated
up to 90 degrees anti-clockwise.
"""
im = im.convert("RGB")
wt, ht = im.size
wt, _ = im.size
bat = Image.open("bot/resources/holidays/halloween/bat-clipart.png")
bat_size = randint(wt//10, wt//7)
rot = randint(0, 90)
Expand Down
Loading

0 comments on commit eed1a17

Please sign in to comment.