Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_stages: [pre-commit, pre-merge-commit, manual]

repos:
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.28
rev: 0.10.3
Comment thread
MattyTheHacker marked this conversation as resolved.
hooks:
- id: uv-lock
always_run: true
Expand All @@ -21,7 +21,7 @@ repos:
- id: codespell

- repo: https://github.com/tombi-toml/tombi-pre-commit
rev: v0.7.25
rev: v0.7.29
Comment thread
MattyTheHacker marked this conversation as resolved.
hooks:
- id: tombi-format
- id: tombi-lint
Expand All @@ -32,7 +32,7 @@ repos:
- id: sync-with-uv

- repo: https://github.com/rhysd/actionlint
rev: v1.7.10
rev: v1.7.11
Comment thread
MattyTheHacker marked this conversation as resolved.
hooks:
- id: actionlint
additional_dependencies: [github.com/wasilibs/go-shellcheck/cmd/shellcheck@latest] # yamllint disable-line rule:key-ordering
Expand All @@ -56,14 +56,14 @@ repos:
args: [--strict]

- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 43.0.6
rev: 43.17.1
Comment thread
MattyTheHacker marked this conversation as resolved.
hooks:
- id: renovate-config-validator
args: [--strict]
stages: [manual]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.36.1
rev: 0.36.2
Comment thread
MattyTheHacker marked this conversation as resolved.
hooks:
- id: check-jsonschema
args: [--schemafile, 'https://json.schemastore.org/yamllint.json'] # yamllint disable-line rule:quoted-strings
Expand Down Expand Up @@ -116,7 +116,7 @@ repos:
args: [--autofix]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.14
rev: v0.15.1
Comment thread
MattyTheHacker marked this conversation as resolved.
hooks:
- id: ruff-check
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion cogs/committee_actions_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def create(
In normal use the autocomplete should be used, but a discord ID can be
used directly if the user wishes to action a user not included in the autocomplete.
"""
member_id: str = action_member_id if action_member_id else str(ctx.user.id)
member_id: str = action_member_id or str(ctx.user.id)

try:
action_user: discord.Member = await self.bot.get_member_from_str_id(member_id)
Expand Down
4 changes: 1 addition & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,7 @@ def _setup_statistics_roles(cls) -> None:
if raw_statistics_role.strip()
}

cls._settings["STATISTICS_ROLES"] = (
statistics_roles if statistics_roles else DEFAULT_STATISTICS_ROLES
)
cls._settings["STATISTICS_ROLES"] = statistics_roles or DEFAULT_STATISTICS_ROLES

@classmethod
def _setup_membership_dependent_roles(cls) -> None:
Expand Down
4 changes: 1 addition & 3 deletions exceptions/config_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def __init__(
self, message: str | None = None, changed_settings: "AbstractSet[str] | None" = None
) -> None:
"""Initialise an Exception to apply configuration changes."""
self.changed_settings: AbstractSet[str] | None = (
changed_settings if changed_settings else set()
)
self.changed_settings: AbstractSet[str] | None = changed_settings or set()

super().__init__(message)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ select = ["ALL", "D204", "D213", "D401"]
task-tags = ["BUG", "DONE", "FIXME", "HACK", "IDEA", "ISSUE", "NOBUG", "NOTE", "REQ", "TODO"]

[tool.ruff.lint.flake8-import-conventions]
aliases = { }
aliases = {}
banned-aliases = { "regex" = ["re"], "numpy" = ["np"], "matplotlib" = ["mpl"], "matplotlib.pyplot" = [
"plt"
] }
Expand Down
21 changes: 8 additions & 13 deletions utils/tex_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,32 +290,27 @@ def group_full_name(self) -> str:
The group-full-name is either retrieved from the provided environment variable
or automatically identified from the name of your group's Discord guild.
"""
return (
settings["_GROUP_FULL_NAME"]
if settings["_GROUP_FULL_NAME"]
else (
"The Computer Science Society"
if (
"computer science society" in self.main_guild.name.lower()
or "css" in self.main_guild.name.lower()
)
else self.main_guild.name
return settings["_GROUP_FULL_NAME"] or (
"The Computer Science Society"
if (
"computer science society" in self.main_guild.name.lower()
or "css" in self.main_guild.name.lower()
)
else self.main_guild.name
)

@property
def group_short_name(self) -> str:
"""
The short colloquial name of your community group.

This defaults to `TeXBot.group_full_name`,
This defaults to `TeXBot.group_full_name`
if no group-short-name is provided/could not be determined.
"""
return (
(
settings["_GROUP_SHORT_NAME"]
if settings["_GROUP_SHORT_NAME"]
else (
or (
"CSS"
if (
"computer science society" in self.group_full_name.lower()
Expand Down
2 changes: 1 addition & 1 deletion utils/tex_bot_base_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ async def send_error(
" ".join(
message_part
for message_part in (
error_code if error_code else "",
error_code or "",
f"({interaction_name})",
str(logging_message),
)
Expand Down
Loading
Loading