mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-25 04:57:54 +00:00
Add flake8-comprehensions linter (#157)
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -81,12 +81,13 @@ addopts = "-p no:warnings"
|
|||||||
ignore = ["E501"]
|
ignore = ["E501"]
|
||||||
line-length = 80
|
line-length = 80
|
||||||
select = [
|
select = [
|
||||||
"B", # flake8-bugbear
|
"B", # flake8-bugbear
|
||||||
"E", # pycodestyle errors
|
"C4", # flake8-comprehensions
|
||||||
"F", # pyflakes
|
"E", # pycodestyle errors
|
||||||
"I", # isort
|
"F", # pyflakes
|
||||||
"S", # flake8-bandit
|
"I", # isort
|
||||||
"W", # pycodestyle warnings
|
"S", # flake8-bandit
|
||||||
|
"W", # pycodestyle warnings
|
||||||
"UP", # pyupgrade
|
"UP", # pyupgrade
|
||||||
]
|
]
|
||||||
target-version = "py37"
|
target-version = "py37"
|
||||||
|
|||||||
Reference in New Issue
Block a user