@@ -66,7 +66,7 @@ def is_url(url: str) -> bool:
66
66
class LabHandler (ExtensionHandlerJinjaMixin , ExtensionHandlerMixin , JupyterHandler ):
67
67
"""Render the JupyterLab View."""
68
68
69
- @lru_cache () # noqa
69
+ @lru_cache # noqa: B019
70
70
def get_page_config (self ) -> dict [str , Any ]:
71
71
"""Construct the page config object"""
72
72
self .application .store_id = getattr ( # type:ignore[attr-defined]
@@ -105,7 +105,7 @@ def get_page_config(self) -> dict[str, Any]:
105
105
.relative_to (server_root )
106
106
.as_posix ()
107
107
)
108
- except Exception : # noqa S110
108
+ except Exception : # noqa: S110
109
109
pass
110
110
# JupyterLab relies on an unset/default path being "/"
111
111
page_config ["preferredPath" ] = preferred_path or "/"
@@ -176,15 +176,15 @@ def get(
176
176
class NotFoundHandler (LabHandler ):
177
177
"""A handler for page not found."""
178
178
179
- @lru_cache () # noqa
179
+ @lru_cache # noqa: B019
180
180
def get_page_config (self ) -> dict [str , Any ]:
181
181
"""Get the page config."""
182
182
page_config = super ().get_page_config ()
183
183
page_config ["notFoundUrl" ] = self .request .path
184
184
return page_config
185
185
186
186
187
- def add_handlers (handlers : list [Any ], extension_app : LabServerApp ) -> None : # noqa
187
+ def add_handlers (handlers : list [Any ], extension_app : LabServerApp ) -> None :
188
188
"""Add the appropriate handlers to the web app."""
189
189
# Normalize directories.
190
190
for name in LabConfig .class_trait_names ():
@@ -272,8 +272,9 @@ def add_handlers(handlers: list[Any], extension_app: LabServerApp) -> None: # n
272
272
allowed_extensions_uris : str = settings_config .get ("allowed_extensions_uris" , "" )
273
273
274
274
if (blocked_extensions_uris ) and (allowed_extensions_uris ):
275
- warnings .warn ( # noqa B028
276
- "Simultaneous blocked_extensions_uris and allowed_extensions_uris is not supported. Please define only one of those."
275
+ warnings .warn (
276
+ "Simultaneous blocked_extensions_uris and allowed_extensions_uris is not supported. Please define only one of those." ,
277
+ stacklevel = 2 ,
277
278
)
278
279
import sys
279
280
@@ -339,7 +340,7 @@ def add_handlers(handlers: list[Any], extension_app: LabServerApp) -> None: # n
339
340
handlers .append ((fallthrough_url , NotFoundHandler ))
340
341
341
342
342
- def _camelCase (base : str ) -> str : # noqa
343
+ def _camelCase (base : str ) -> str :
343
344
"""Convert a string to camelCase.
344
345
https://stackoverflow.com/a/20744956
345
346
"""
0 commit comments