Skip to content

Commit

Permalink
Removed CamelCase TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
nfearnley committed May 21, 2024
1 parent ef4cc68 commit 0061337
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
33 changes: 0 additions & 33 deletions sizebot/lib/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
class DigiException(Exception):
level = logging.WARNING

# TODO: CamelCase
def format_message(self) -> str | None:
return None

# TODO: CamelCase
def format_user_message(self) -> str | None:
return None

Expand All @@ -30,11 +28,9 @@ def __str__(self) -> str:
class DigiContextException(Exception):
level = logging.WARNING

# TODO: CamelCase
async def format_message(self, ctx: BotContext) -> str | None:
return None

# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str | None:
return None

Expand All @@ -51,7 +47,6 @@ def __init__(self, guildid: int, userid: int, unreg: bool = False):
self.userid = userid
self.unreg = unreg

# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str:
user = await ctx.guild.fetch_member(self.userid)
usernick = user.display_name
Expand All @@ -67,29 +62,24 @@ class GuildNotFoundException(DigiException):
def __init__(self, guildid: int):
self.guildid = guildid

# TODO: CamelCase
def format_message(self) -> str:
return f"Guild {self.guildid} not found."


class ValueIsZeroException(DigiException):
# TODO: CamelCase
def format_message(self) -> str:
return "Value zero received when unexpected."

# TODO: CamelCase
def format_user_message(self) -> str:
return (
"Nice try.\n"
"You can't change by a value of zero.")


class ValueIsOneException(DigiException):
# TODO: CamelCase
def format_message(self) -> str:
return "Value one received when unexpected."

# TODO: CamelCase
def format_user_message(self) -> str:
return (
"Nice try.\n"
Expand All @@ -103,7 +93,6 @@ class ChangeMethodInvalidException(DigiContextException):
def __init__(self, changemethod: str):
self.changemethod = changemethod

# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str:
usernick = ctx.author.display_name
return f"Sorry, {usernick}! {self.changemethod} is not a valid change method."
Expand All @@ -112,7 +101,6 @@ async def format_user_message(self, ctx: BotContext) -> str:
class CannotSaveWithoutIDException(DigiException):
level = logging.CRITICAL

# TODO: CamelCase
def format_message(self) -> str:
return "Tried to save a user without an ID."

Expand All @@ -122,7 +110,6 @@ def __init__(self, sizevalue: str, kind: str):
self.sizevalue = sizevalue
self.kind = kind

# TODO: CamelCase
def format_user_message(self) -> str:
return f"{self.sizevalue!r} is an unrecognized {self.kind} value."

Expand All @@ -131,7 +118,6 @@ class InvalidStat(DigiException):
def __init__(self, value: str):
self.value = value

# TODO: CamelCase
def format_user_message(self) -> str:
return f"{self.value!r} is an unrecognized stat."

Expand All @@ -140,7 +126,6 @@ class InvalidStatTag(DigiException):
def __init__(self, value: str):
self.value = value

# TODO: CamelCase
def format_user_message(self) -> str:
return f"{self.value!r} is an unrecognized stat tag."

Expand All @@ -149,7 +134,6 @@ class InvalidObject(DigiException):
def __init__(self, name: str):
self.name = name

# TODO: CamelCase
def format_user_message(self) -> str:
return f"{self.name!r} is an unrecognized object."

Expand All @@ -158,11 +142,9 @@ class InvalidMacrovisionModelException(DigiException):
def __init__(self, name: str):
self.name = name

# TODO: CamelCase
def format_message(self) -> str:
return f"{self.name!r} is an unrecognized Macrovision model."

# TODO: CamelCase
def format_user_message(self) -> str:
return f"{self.name!r} is an unrecognized Macrovision model."

Expand All @@ -175,11 +157,9 @@ def __init__(self, model: str, view: str):
if not macrovision.is_model(model):
raise InvalidMacrovisionModelException(self.model)

# TODO: CamelCase
def format_message(self) -> str:
return f"{self.view!r} is an unrecognized view for the Macrovision model {self.model!r}."

# TODO: CamelCase
def format_user_message(self) -> str:
return f"{self.view!r} is an unrecognized view for the Macrovision model {self.model!r}."

Expand All @@ -188,36 +168,30 @@ class InvalidRollException(DigiException):
def __init__(self, dString: str):
self.dString = dString

# TODO: CamelCase
def format_user_message(self) -> str:
return f"Invalid roll string `{self.dString}`."


class AdminPermissionException(DigiContextException):
# TODO: CamelCase
async def format_message(self, ctx: BotContext) -> str:
usernick = ctx.author.display_name
return f"{usernick} tried to run an admin command."

# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str:
usernick = ctx.author.display_name
return f"{usernick} tried to run an admin command. This incident will be reported."


class MultilineAsNonFirstCommandException(DigiContextException):
# TODO: CamelCase
async def format_message(self, ctx: BotContext) -> str:
usernick = ctx.author.display_name
return f"{usernick} tried to run a multi-line command in the middle of a sequence."

# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str:
return "You are unable to run a command that takes a multi-line argument in the middle of a batch command sequence. Please try running these commands seperately."


class ArgumentException(DigiContextException):
# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str:
return f"Please enter `{ctx.prefix}{ctx.invoked_with} {ctx.command.signature}`."

Expand All @@ -226,7 +200,6 @@ class UserMessedUpException(DigiContextException):
def __init__(self, custommessage: str):
self.custommessage = custommessage

# TODO: CamelCase
async def format_user_message(self, ctx: BotContext) -> str:
return self.custommessage

Expand All @@ -237,11 +210,9 @@ class ThisShouldNeverHappenException(DigiException):
def __init__(self, custommessage: str):
self.custommessage = custommessage

# TODO: CamelCase
def format_user_message(self) -> str:
return "This should never happen. Something very wrong has occured."

# TODO: CamelCase
def format_message(self) -> str:
return self.custommessage

Expand All @@ -251,11 +222,9 @@ def __init__(self, s: str, t: str):
self.s = s
self.t = t

# TODO: CamelCase
def format_message(self) -> str:
return f"Could not parse {self.s} into a {self.t}."

# TODO: CamelCase
def format_user_message(self) -> str:
return f"Could not parse {self.s} into a {self.t}."

Expand All @@ -264,10 +233,8 @@ class UnfoundStatException(DigiException):
def __init__(self, s: list[Any]):
self.s = utils.sentence_join(getattr(t, "key", repr(t)) for t in s)

# TODO: CamelCase
def format_message(self) -> str:
return f"Could not calculate the {self.s} stat(s)."

# TODO: CamelCase
def format_user_message(self) -> str:
return f"Could not calculate the {self.s} stat(s)."
1 change: 0 additions & 1 deletion sizebot/lib/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class TooManyMenuOptionsException(DigiException):
# TODO: CamelCase
def format_message(self) -> str:
return "Too many options for this reaction menu. (limit is 20.)"

Expand Down

0 comments on commit 0061337

Please sign in to comment.