Skip to content

Commit 0ca483f

Browse files
authored
Fix linting errors due to Ruff fmt (#216)
1 parent 0a2136c commit 0ca483f

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

bot/cogs/tickets.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ async def ticket_info(self, ctx: RoboContext) -> None:
488488
)
489489
embed.add_field(
490490
name="Created At",
491-
value=format_dt(ticket.thread.created_at),
491+
value=format_dt(ticket.thread.created_at), # type: ignore
492492
inline=False,
493-
) # type: ignore
493+
)
494494
await ctx.send(embed=embed)
495495

496496
# As the guild has an entry in the cache,

bot/cogs/utilities.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def format_commit(self, commit: pygit2.Commit) -> str:
4646
return f"[`{short_sha2}`](https://github.com/transprogrammer/rodhaj/commit/{commit_id}) {short} ({offset})"
4747

4848
def get_last_commits(self, count: int = 5):
49-
repo = pygit2.Repository(".git")
49+
repo = pygit2.Repository(".git") # type: ignore # It technically is
5050
commits = list(
5151
itertools.islice(repo.walk(repo.head.target, SortMode.TOPOLOGICAL), count)
5252
)
@@ -55,7 +55,7 @@ def get_last_commits(self, count: int = 5):
5555
def get_current_branch(
5656
self,
5757
) -> str:
58-
repo = pygit2.Repository(".git")
58+
repo = pygit2.Repository(".git") # type: ignore
5959
return repo.head.shorthand
6060

6161
async def fetch_num_active_tickets(self) -> int:
@@ -83,6 +83,7 @@ async def about(self, ctx: RoboContext) -> None:
8383
# R. Danny's way of doing it is probably close enough anyways
8484
memory_usage = self.process.memory_full_info().uss / 1024**2
8585
cpu_usage = self.process.cpu_percent() / psutil.cpu_count()
86+
bot_user: discord.ClientUser = self.bot.user # type: ignore
8687

8788
revisions = "See [GitHub](https://github.com/transprogrammer/rodhaj)"
8889
working_branch = "Docker"
@@ -96,9 +97,7 @@ async def about(self, ctx: RoboContext) -> None:
9697
f"Made with discord.py v{discord.__version__} | Running Python {platform.python_version()}"
9798
)
9899
embed = Embed()
99-
embed.set_author(
100-
name=self.bot.user.name, icon_url=self.bot.user.display_avatar.url
101-
) # type: ignore
100+
embed.set_author(name=bot_user.name, icon_url=bot_user.display_avatar.url)
102101
embed.title = "Rodhaj"
103102
embed.description = (
104103
"Rodhaj is a modern, improved ModMail bot designed exclusively for "

bot/libs/utils/pages/paginator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ async def start(
154154
) -> None:
155155
if (
156156
self.check_embeds
157-
and not self.ctx.channel.permissions_for(self.ctx.me).embed_links
158-
): # type: ignore
157+
and not self.ctx.channel.permissions_for(self.ctx.me).embed_links # type: ignore
158+
):
159159
await self.ctx.send(
160160
"Bot does not have embed links permission in this channel.",
161161
ephemeral=True,

bot/rodhaj.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ async def on_command_error(
124124
original = error.original
125125
if not isinstance(original, discord.HTTPException):
126126
self.logger.exception(
127-
"In %s:", ctx.command.qualified_name, exc_info=original # type: ignore
127+
"In %s:",
128+
ctx.command.qualified_name, # type: ignore
129+
exc_info=original,
128130
)
129131
elif isinstance(error, commands.BadArgument):
130132
await ctx.send(str(error))

0 commit comments

Comments
 (0)