Skip to content

Commit 9ebe525

Browse files
committed
😡More Ruff it up
1 parent e179855 commit 9ebe525

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ exclude = ["**/__pycache__"]
1818

1919
deprecateTypingAliases = true
2020
reportMissingTypeStubs = "none" # a lot of libs don't have stubs
21-
reportPrivateUsage = "none" # it's my choice, reeee
21+
reportPrivateUsage = "none" # it's my choice
2222
reportImplicitOverride = "warning" # I love it
2323

2424
# Unnecessary
2525
reportUnnecessaryIsInstance = "none" # I like "else" raising the error if type is somehow not it
2626
reportUnnecessaryTypeIgnoreComment = "warning" # why it's "none" by default, even for strict ?!
2727

28-
# Unused stuff - yes, I write a lot of unused stuff **GIGACHAD music**
28+
# Unused stuff - yes, I write a lot of unused stuff
2929
reportUnusedImport = "warning"
3030
reportUnusedVariable = "none"
3131
reportUnusedClass = "none"
@@ -106,6 +106,7 @@ select = [
106106
]
107107
ignore = [
108108
"ANN401", # `Any` is the correct type in some cases
109+
"ASYNC109", # dpy commonly uses this parameter
109110
"ASYNC116", # Long sleeps are fine
110111
"C90", # mc cabe complexity memes
111112
"F401", # unused imports
@@ -132,10 +133,14 @@ ignore = [
132133
# "UP038",
133134

134135
# DOC STRINGS
136+
# general doc string exceptions
135137
"D100", # Missing docstring in module: no, module level docs aren't always needed
136138
"D105", # Missing docstring in magic method: documenting magic methods is often dumb.
137139
"D107", # Missing docstring in `__init__`: __init__ is the wrong place to doc this.
138-
"D401", # Doc should be starting with an imperative verb: dumb rule tbh.
140+
"D401", # Doc should be starting with an imperative verb: dumb rule, to be honest.
141+
# doc string exceptions
142+
# for this bot because it's a bot and it's pointless to document *everything* in one-man project.
143+
"DOC201", # `return` is not documented in docstring
139144

140145
# "D104", # Missing docstring in public package. Otherwise spams __init__.py and such.
141146
# "D417", # Missing argument description. Otherwise, it keeps asking to document interaction/context args.

utils/guards.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def is_vps() -> Any:
1818
kill the bot process or reboot it.
1919
"""
2020

21-
async def predicate(_: commands.Context) -> bool:
21+
def predicate(_: commands.Context) -> bool:
2222
if platform.system() == "Windows":
2323
# wrong PC
2424
msg = f"Only production bot allows usage of this command {const.FFZ.peepoPolice}"
@@ -31,7 +31,7 @@ async def predicate(_: commands.Context) -> bool:
3131
def is_online() -> Any:
3232
"""Allow the command to be completed only when Irene's stream is online."""
3333

34-
async def predicate(ctx: commands.Context[LueBot]) -> bool:
35-
return ctx.bot.aluerie_online
34+
def predicate(ctx: commands.Context[LueBot]) -> bool: # type:ignore[reportInvalidTypeArgument]
35+
return ctx.bot.aluerie_online # type:ignore[reportAttributeAccessIssue]
3636

3737
return commands.guard(predicate)

0 commit comments

Comments
 (0)