Skip to content

Commit d60f4cc

Browse files
committed
Fix linting issues
1 parent 1f3aaf5 commit d60f4cc

6 files changed

Lines changed: 13 additions & 22 deletions

File tree

cogs/committee_actions_tracking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async def create(
238238
In normal use the autocomplete should be used, but a discord ID can be
239239
used directly if the user wishes to action a user not included in the autocomplete.
240240
"""
241-
member_id: str = action_member_id if action_member_id else str(ctx.user.id)
241+
member_id: str = action_member_id or str(ctx.user.id)
242242

243243
try:
244244
action_user: discord.Member = await self.bot.get_member_from_str_id(member_id)

config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -880,9 +880,7 @@ def _setup_statistics_roles(cls) -> None:
880880
if raw_statistics_role.strip()
881881
}
882882

883-
cls._settings["STATISTICS_ROLES"] = (
884-
statistics_roles if statistics_roles else DEFAULT_STATISTICS_ROLES
885-
)
883+
cls._settings["STATISTICS_ROLES"] = statistics_roles or DEFAULT_STATISTICS_ROLES
886884

887885
@classmethod
888886
def _setup_membership_dependent_roles(cls) -> None:

exceptions/config_changes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def __init__(
3535
self, message: str | None = None, changed_settings: "AbstractSet[str] | None" = None
3636
) -> None:
3737
"""Initialise an Exception to apply configuration changes."""
38-
self.changed_settings: AbstractSet[str] | None = (
39-
changed_settings if changed_settings else set()
40-
)
38+
self.changed_settings: AbstractSet[str] | None = changed_settings or set()
4139

4240
super().__init__(message)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ select = ["ALL", "D204", "D213", "D401"]
184184
task-tags = ["BUG", "DONE", "FIXME", "HACK", "IDEA", "ISSUE", "NOBUG", "NOTE", "REQ", "TODO"]
185185

186186
[tool.ruff.lint.flake8-import-conventions]
187-
aliases = { }
187+
aliases = {}
188188
banned-aliases = { "regex" = ["re"], "numpy" = ["np"], "matplotlib" = ["mpl"], "matplotlib.pyplot" = [
189189
"plt"
190190
] }

utils/tex_bot.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -290,32 +290,27 @@ def group_full_name(self) -> str:
290290
The group-full-name is either retrieved from the provided environment variable
291291
or automatically identified from the name of your group's Discord guild.
292292
"""
293-
return (
294-
settings["_GROUP_FULL_NAME"]
295-
if settings["_GROUP_FULL_NAME"]
296-
else (
297-
"The Computer Science Society"
298-
if (
299-
"computer science society" in self.main_guild.name.lower()
300-
or "css" in self.main_guild.name.lower()
301-
)
302-
else self.main_guild.name
293+
return settings["_GROUP_FULL_NAME"] or (
294+
"The Computer Science Society"
295+
if (
296+
"computer science society" in self.main_guild.name.lower()
297+
or "css" in self.main_guild.name.lower()
303298
)
299+
else self.main_guild.name
304300
)
305301

306302
@property
307303
def group_short_name(self) -> str:
308304
"""
309305
The short colloquial name of your community group.
310306
311-
This defaults to `TeXBot.group_full_name`,
307+
This defaults to `TeXBot.group_full_name`
312308
if no group-short-name is provided/could not be determined.
313309
"""
314310
return (
315311
(
316312
settings["_GROUP_SHORT_NAME"]
317-
if settings["_GROUP_SHORT_NAME"]
318-
else (
313+
or (
319314
"CSS"
320315
if (
321316
"computer science society" in self.group_full_name.lower()

utils/tex_bot_base_cog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async def send_error(
149149
" ".join(
150150
message_part
151151
for message_part in (
152-
error_code if error_code else "",
152+
error_code or "",
153153
f"({interaction_name})",
154154
str(logging_message),
155155
)

0 commit comments

Comments
 (0)