Add flake8-comprehensions linter (#157)

This commit is contained in:
Martijn Pieters
2023-05-16 13:18:53 +01:00
committed by GitHub
parent 50e3f91a87
commit d938bbe4d2
3 changed files with 10 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ async def get_ret():
@app.get("/")
@cache(namespace="test", expire=10)
async def index():
return dict(ret=await get_ret())
return {"ret": await get_ret()}
@app.get("/clear")

View File

@@ -38,7 +38,7 @@ async def get_ret():
@app.get("/")
@cache(namespace="test", expire=10)
async def index():
return dict(ret=await get_ret())
return {"ret": await get_ret()}
@app.get("/clear")
@@ -58,7 +58,7 @@ async def get_data(request: Request, response: Response):
@cache(namespace="test", expire=10)
def blocking():
time.sleep(2)
return dict(ret=42)
return {"ret": 42}
@app.get("/datetime")

View File

@@ -81,12 +81,13 @@ addopts = "-p no:warnings"
ignore = ["E501"]
line-length = 80
select = [
"B", # flake8-bugbear
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"S", # flake8-bandit
"W", # pycodestyle warnings
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"S", # flake8-bandit
"W", # pycodestyle warnings
"UP", # pyupgrade
]
target-version = "py37"