feat: adhere to ruff's B rules (#2423)

* feat: adhere to ruff's `B` rules
last of the ruff checks.
closes #2308
* B904
* B008
* B005
* B025
* cleanup on fake
This commit is contained in:
dni ⚡
2024-04-17 13:11:51 +02:00
committed by GitHub
parent e13a37c193
commit 98ec59df96
28 changed files with 226 additions and 169 deletions
+4 -2
View File
@@ -48,18 +48,20 @@ def main(
# this beautiful beast parses all command line arguments and
# passes them to the uvicorn server
# TODO: why is this needed? it would be better only to rely on the commands options
d = {}
for a in ctx.args:
item = a.split("=")
if len(item) > 1: # argument like --key=value
print(a, item)
d[item[0].strip("--").replace("-", "_")] = (
d[item[0].strip("--").replace("-", "_")] = ( # noqa: B005
int(item[1]) # need to convert to int if it's a number
if item[1].isdigit()
else item[1]
)
else:
d[a.strip("--")] = True # argument like --key
# argument like --key
d[a.strip("--")] = True # noqa: B005
while True:
config = uvicorn.Config(