Skip to content

Commit 356ba78

Browse files
committed
Added ignore type codes
1 parent ec6a3ab commit 356ba78

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

debug_toolbar/middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, app: ASGIApp, **settings: t.Any) -> None:
3030
super().__init__(app)
3131
self.settings = DebugToolbarSettings(**settings)
3232
self.show_toolbar = import_string(self.settings.SHOW_TOOLBAR_CALLBACK)
33-
self.router: APIRouter = app # type: ignore
33+
self.router: APIRouter = app # type: ignore[assignment]
3434

3535
while not isinstance(self.router, APIRouter):
3636
self.router = self.router.app
@@ -86,7 +86,7 @@ async def dispatch(
8686
toolbar.generate_server_timing_header(response)
8787

8888
if is_html:
89-
async for body in response.body_iterator: # type: ignore
89+
async for body in response.body_iterator: # type: ignore[attr-defined]
9090
if not isinstance(body, bytes):
9191
body = body.encode(response.charset)
9292

@@ -102,7 +102,7 @@ async def dispatch(
102102
async def stream() -> t.AsyncGenerator[bytes, None]:
103103
yield body
104104

105-
response.body_iterator = stream() # type: ignore
105+
response.body_iterator = stream() # type: ignore[attr-defined]
106106
else:
107107
data = parse.quote(json.dumps(toolbar.refresh()))
108108
response.set_cookie(key="dtRefresh", value=data)

debug_toolbar/panels/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
try:
1313
import threading
1414
except ImportError:
15-
threading = None # type: ignore
15+
threading = None # type: ignore[assignment]
1616

1717

1818
class LogCollector:

debug_toolbar/panels/pydantic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ def decorator(
8484
return decorator
8585

8686
async def process_request(self, request: Request) -> Response:
87-
ModelField.validate = self.validate # type: ignore
87+
ModelField.validate = self.validate # type: ignore[assignment]
8888
try:
8989
response = await super().process_request(request)
9090
finally:
91-
ModelField.validate = _validate # type: ignore
91+
ModelField.validate = _validate # type: ignore[assignment]
9292
return response
9393

9494
async def generate_stats(self, request: Request, response: Response) -> Stats:

debug_toolbar/panels/timer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
try:
1010
import resource
1111
except ImportError:
12-
resource = None # type: ignore
12+
resource = None # type: ignore[assignment]
1313

1414

1515
class TimerPanel(Panel):

debug_toolbar/panels/tortoise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def process_request(self, request: Request) -> Response:
7878

7979
for conn in connections.all():
8080
db = DBWrapper(conn, self.on_execute)
81-
connections.set(conn.connection_name, db) # type: ignore
81+
connections.set(conn.connection_name, db) # type: ignore[arg-type]
8282
try:
8383
response = await super().process_request(request)
8484
finally:

debug_toolbar/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class DebugToolbarSettings(BaseSettings):
6868
description="URL prefix to use for toolbar endpoints.",
6969
)
7070
STATIC_URL: str = Field(
71-
f"{API_URL.default}/static", # type: ignore
71+
f"{API_URL.default}/static", # type: ignore[attr-defined]
7272
description="URL to use when referring to toolbar static files.",
7373
)
7474
SHOW_TOOLBAR_CALLBACK: str = Field(

debug_toolbar/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def is_coroutine(endpoint: t.Callable) -> bool:
5656
while isinstance(handler, functools.partial):
5757
handler = handler.func
5858
if not (inspect.ismethod(handler) or inspect.isfunction(handler)):
59-
handler = handler.__call__ # type: ignore
59+
handler = handler.__call__ # type: ignore[operator]
6060
return asyncio.iscoroutinefunction(handler)
6161

6262

0 commit comments

Comments
 (0)