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:
+4
-2
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user