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("/") @app.get("/")
@cache(namespace="test", expire=10) @cache(namespace="test", expire=10)
async def index(): async def index():
return dict(ret=await get_ret()) return {"ret": await get_ret()}
@app.get("/clear") @app.get("/clear")

View File

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

View File

@@ -82,6 +82,7 @@ ignore = ["E501"]
line-length = 80 line-length = 80
select = [ select = [
"B", # flake8-bugbear "B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle errors "E", # pycodestyle errors
"F", # pyflakes "F", # pyflakes
"I", # isort "I", # isort