mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
Switch to ruff to handle linting and formatting
Ruff handles black, flake8 and isort in one package, and is way faster. The isort rules had not been enforced, so this commit includes a lot of import resorting changes. I switched to flake8-bugbear and the standard black-compatible line length of 80 + 10% (so max 88 characters), so some line reflowing is included too. Finally, because bugbear rightly points out that `setattr()` is less performant, I've switched the `__signature__` assigment back to using a direct assignment with type ignore comment.
This commit is contained in:
@@ -4,13 +4,13 @@ from typing import Dict, Optional
|
||||
import pendulum
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from pydantic import BaseModel
|
||||
from starlette.requests import Request
|
||||
from starlette.responses import JSONResponse, Response
|
||||
|
||||
from fastapi_cache import FastAPICache
|
||||
from fastapi_cache.backends.inmemory import InMemoryBackend
|
||||
from fastapi_cache.decorator import cache
|
||||
from pydantic import BaseModel
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user