Lint: unused arguments
This commit is contained in:
@@ -22,11 +22,13 @@ fileserver = FileServer()
|
|||||||
|
|
||||||
@bp.before_server_start
|
@bp.before_server_start
|
||||||
async def start_fileserver(app):
|
async def start_fileserver(app):
|
||||||
|
_ = app
|
||||||
await fileserver.start()
|
await fileserver.start()
|
||||||
|
|
||||||
|
|
||||||
@bp.after_server_stop
|
@bp.after_server_stop
|
||||||
async def stop_fileserver(app):
|
async def stop_fileserver(app):
|
||||||
|
_ = app
|
||||||
await fileserver.stop()
|
await fileserver.stop()
|
||||||
|
|
||||||
|
|
||||||
@@ -100,6 +102,7 @@ async def watch(req, ws):
|
|||||||
|
|
||||||
|
|
||||||
def subscribe(uuid, ws):
|
def subscribe(uuid, ws):
|
||||||
|
_ = ws
|
||||||
with watching.state.lock:
|
with watching.state.lock:
|
||||||
q = watching.pubsub[uuid] = asyncio.Queue()
|
q = watching.pubsub[uuid] = asyncio.Queue()
|
||||||
# Init with disk usage and full tree
|
# Init with disk usage and full tree
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ async def main_start(app):
|
|||||||
|
|
||||||
@app.after_server_start
|
@app.after_server_start
|
||||||
async def main_after_start(app):
|
async def main_after_start(app):
|
||||||
|
_ = app
|
||||||
onlyoffice.log_reachable_info()
|
onlyoffice.log_reachable_info()
|
||||||
|
|
||||||
|
|
||||||
@@ -255,6 +256,7 @@ async def wwwroot(req, path=""):
|
|||||||
|
|
||||||
@app.route("/favicon.ico", methods=["GET", "HEAD"])
|
@app.route("/favicon.ico", methods=["GET", "HEAD"])
|
||||||
async def favicon(req):
|
async def favicon(req):
|
||||||
|
_ = req
|
||||||
# Browsers keep asking for it when viewing files (not HTML with icon link)
|
# Browsers keep asking for it when viewing files (not HTML with icon link)
|
||||||
return redirect("/assets/logo-ctv8tVwU.svg", status=308)
|
return redirect("/assets/logo-ctv8tVwU.svg", status=308)
|
||||||
|
|
||||||
|
|||||||
@@ -268,6 +268,7 @@ def _log_webdav_user_agent_once(request, user_agent: str):
|
|||||||
|
|
||||||
|
|
||||||
def _build_ua_auth_headers(request, *, include_hint=False) -> dict[str, str]:
|
def _build_ua_auth_headers(request, *, include_hint=False) -> dict[str, str]:
|
||||||
|
_ = include_hint
|
||||||
user_agent = request.headers.get("user-agent", "")
|
user_agent = request.headers.get("user-agent", "")
|
||||||
_log_webdav_user_agent_once(request, user_agent)
|
_log_webdav_user_agent_once(request, user_agent)
|
||||||
if _is_windows_auth_client(user_agent):
|
if _is_windows_auth_client(user_agent):
|
||||||
@@ -1081,6 +1082,7 @@ async def login_page(request):
|
|||||||
|
|
||||||
def _login_success_page(username: str) -> str:
|
def _login_success_page(username: str) -> str:
|
||||||
"""Minimal page that signals auth-success to parent iframe."""
|
"""Minimal page that signals auth-success to parent iframe."""
|
||||||
|
_ = username
|
||||||
return str(
|
return str(
|
||||||
Document().script_("window.parent.postMessage({type:'auth-success'},'*')")
|
Document().script_("window.parent.postMessage({type:'auth-success'},'*')")
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -281,6 +281,8 @@ async def head_file(request, name=""):
|
|||||||
@bp.route("/", methods=["OPTIONS"], name="options_root", strict_slashes=False)
|
@bp.route("/", methods=["OPTIONS"], name="options_root", strict_slashes=False)
|
||||||
@bp.route("/<name:path>", methods=["OPTIONS"], name="options_path")
|
@bp.route("/<name:path>", methods=["OPTIONS"], name="options_path")
|
||||||
async def dav_options(request, name=""):
|
async def dav_options(request, name=""):
|
||||||
|
_ = request
|
||||||
|
_ = name
|
||||||
return HTTPResponse(
|
return HTTPResponse(
|
||||||
status=200,
|
status=200,
|
||||||
headers={
|
headers={
|
||||||
|
|||||||
@@ -266,6 +266,7 @@ def process_image_pyvips(path, *, maxsize, quality):
|
|||||||
|
|
||||||
|
|
||||||
def process_image_buffer(data: bytes, *, quality, maxsize, maxzoom):
|
def process_image_buffer(data: bytes, *, quality, maxsize, maxzoom):
|
||||||
|
_ = maxzoom
|
||||||
t_start = perf_counter()
|
t_start = perf_counter()
|
||||||
img = pyvips.Image.new_from_buffer(data, "")
|
img = pyvips.Image.new_from_buffer(data, "")
|
||||||
img = img.autorot()
|
img = img.autorot()
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ def run(*, dev=False):
|
|||||||
|
|
||||||
|
|
||||||
def check_cert(certdir, domain):
|
def check_cert(certdir, domain):
|
||||||
|
_ = domain
|
||||||
if (certdir / "privkey.pem").exist() and (certdir / "fullchain.pem").exists():
|
if (certdir / "privkey.pem").exist() and (certdir / "fullchain.pem").exists():
|
||||||
return
|
return
|
||||||
# Certificate provisioning is external; files must exist before startup.
|
# Certificate provisioning is external; files must exist before startup.
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ app = Sanic("server80")
|
|||||||
# Send all HTTP users to HTTPS
|
# Send all HTTP users to HTTPS
|
||||||
@app.exception(exceptions.NotFound, exceptions.MethodNotSupported)
|
@app.exception(exceptions.NotFound, exceptions.MethodNotSupported)
|
||||||
def redirect_everything_else(request, exception):
|
def redirect_everything_else(request, exception):
|
||||||
|
_ = exception
|
||||||
server, path = request.server_name, request.path
|
server, path = request.server_name, request.path
|
||||||
if server and path.startswith("/"):
|
if server and path.startswith("/"):
|
||||||
return response.redirect(f"https://{server}{path}", status=308)
|
return response.redirect(f"https://{server}{path}", status=308)
|
||||||
@@ -15,6 +16,7 @@ def redirect_everything_else(request, exception):
|
|||||||
# ACME challenge for LetsEncrypt
|
# ACME challenge for LetsEncrypt
|
||||||
@app.get("/.well-known/acme-challenge/<challenge>")
|
@app.get("/.well-known/acme-challenge/<challenge>")
|
||||||
async def letsencrypt(request, challenge):
|
async def letsencrypt(request, challenge):
|
||||||
|
_ = request
|
||||||
try:
|
try:
|
||||||
return response.text(acme_challenges[challenge])
|
return response.text(acme_challenges[challenge])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
@@ -349,6 +349,7 @@ bp = Blueprint("sso", url_prefix="/auth")
|
|||||||
@bp.websocket("/ws/<path:path>")
|
@bp.websocket("/ws/<path:path>")
|
||||||
async def auth_websocket_proxy(request, ws, path=""):
|
async def auth_websocket_proxy(request, ws, path=""):
|
||||||
"""Proxy WebSocket connections to the auth backend."""
|
"""Proxy WebSocket connections to the auth backend."""
|
||||||
|
_ = path
|
||||||
await proxy_auth_websocket(request, ws)
|
await proxy_auth_websocket(request, ws)
|
||||||
|
|
||||||
|
|
||||||
@@ -363,6 +364,7 @@ async def auth_websocket_proxy_root(request, ws):
|
|||||||
)
|
)
|
||||||
async def auth_proxy(request, path=""):
|
async def auth_proxy(request, path=""):
|
||||||
"""Proxy all auth requests to the auth backend."""
|
"""Proxy all auth requests to the auth backend."""
|
||||||
|
_ = path
|
||||||
return await proxy_auth_request(request)
|
return await proxy_auth_request(request)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ if sys.platform == "win32":
|
|||||||
|
|
||||||
def get_allocated_size(path: Path, st: stat_result) -> int:
|
def get_allocated_size(path: Path, st: stat_result) -> int:
|
||||||
"""Get actual disk allocation on Windows using GetCompressedFileSizeW."""
|
"""Get actual disk allocation on Windows using GetCompressedFileSizeW."""
|
||||||
|
_ = st
|
||||||
high = wintypes.DWORD()
|
high = wintypes.DWORD()
|
||||||
low = GetCompressedFileSizeW(str(path), ctypes.byref(high))
|
low = GetCompressedFileSizeW(str(path), ctypes.byref(high))
|
||||||
if low == INVALID_FILE_SIZE and ctypes.get_last_error() != 0:
|
if low == INVALID_FILE_SIZE and ctypes.get_last_error() != 0:
|
||||||
@@ -41,6 +42,7 @@ else:
|
|||||||
|
|
||||||
def get_allocated_size(path: Path, st: stat_result) -> int:
|
def get_allocated_size(path: Path, st: stat_result) -> int:
|
||||||
"""Get actual disk allocation on Unix using st_blocks."""
|
"""Get actual disk allocation on Unix using st_blocks."""
|
||||||
|
_ = path
|
||||||
# st_blocks is in 512-byte units
|
# st_blocks is in 512-byte units
|
||||||
return st.st_blocks * 512
|
return st.st_blocks * 512
|
||||||
|
|
||||||
@@ -249,6 +251,7 @@ def update_root(loop):
|
|||||||
def update_path(rootmod: list[FileEntry], relpath: PurePosixPath, loop):
|
def update_path(rootmod: list[FileEntry], relpath: PurePosixPath, loop):
|
||||||
"""Called on FS updates, check the filesystem and broadcast any changes."""
|
"""Called on FS updates, check the filesystem and broadcast any changes."""
|
||||||
new = walk(relpath)
|
new = walk(relpath)
|
||||||
|
_ = loop
|
||||||
obegin, old = treeget(rootmod, relpath)
|
obegin, old = treeget(rootmod, relpath)
|
||||||
|
|
||||||
if old == new:
|
if old == new:
|
||||||
|
|||||||
+1
-2
@@ -130,7 +130,6 @@ ignore = [
|
|||||||
"ANN202", # legacy codebase: no full runtime annotation coverage yet
|
"ANN202", # legacy codebase: no full runtime annotation coverage yet
|
||||||
"ANN204", # legacy codebase: no full runtime annotation coverage yet
|
"ANN204", # legacy codebase: no full runtime annotation coverage yet
|
||||||
"ANN205", # legacy codebase: no full runtime annotation coverage yet
|
"ANN205", # legacy codebase: no full runtime annotation coverage yet
|
||||||
"ARG001", # framework and callback signatures commonly require unused args
|
|
||||||
"BLE001", # broad catch remains in boundary/proxy/error-handling paths
|
"BLE001", # broad catch remains in boundary/proxy/error-handling paths
|
||||||
"C901", # legacy complexity; keep other correctness rules enabled
|
"C901", # legacy complexity; keep other correctness rules enabled
|
||||||
"D100", # legacy docs not yet standardized
|
"D100", # legacy docs not yet standardized
|
||||||
@@ -161,7 +160,7 @@ ignore = [
|
|||||||
"TRY003", # exception-message strictness too noisy on legacy handlers
|
"TRY003", # exception-message strictness too noisy on legacy handlers
|
||||||
]
|
]
|
||||||
isort.known-first-party = ["cista"]
|
isort.known-first-party = ["cista"]
|
||||||
per-file-ignores."tests/*" = ["S", "ANN", "D", "INP", "PLR2004"]
|
per-file-ignores."tests/*" = ["S", "ANN", "D", "INP", "PLR2004", "ARG001"]
|
||||||
per-file-ignores."scripts/*" = ["T20"]
|
per-file-ignores."scripts/*" = ["T20"]
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
|
|||||||
Reference in New Issue
Block a user