This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new ad2f27d  Fix a few incongruities with standard lints
ad2f27d is described below

commit ad2f27d7eaf8a6e3589a6a1140d4069a27c15b49
Author: Sean B. Palmer <[email protected]>
AuthorDate: Tue Oct 21 18:51:52 2025 +0100

    Fix a few incongruities with standard lints
---
 atr/jwtoken.py      |  3 +--
 atr/routes/draft.py |  8 ++------
 atr/routes/keys.py  | 10 ++--------
 atr/util.py         |  5 +----
 4 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/atr/jwtoken.py b/atr/jwtoken.py
index 379142a..6b44cdc 100644
--- a/atr/jwtoken.py
+++ b/atr/jwtoken.py
@@ -129,7 +129,6 @@ def _extract_bearer_token(request: quart.Request) -> str:
     scheme, _, token = header.partition(" ")
     if scheme.lower() != "bearer" or not token:
         raise base.ASFQuartException(
-            "Authentication required. Please provide a valid Bearer token in 
the Authorization header",
-            errorcode=401
+            "Authentication required. Please provide a valid Bearer token in 
the Authorization header", errorcode=401
         )
     return token
diff --git a/atr/routes/draft.py b/atr/routes/draft.py
index 015f399..dcac593 100644
--- a/atr/routes/draft.py
+++ b/atr/routes/draft.py
@@ -190,10 +190,7 @@ async def hashgen(
     form = await quart.request.form
     hash_type = form.get("hash_type")
     if hash_type not in {"sha256", "sha512"}:
-        raise base.ASFQuartException(
-            f"Invalid hash type '{hash_type}'. Supported types: sha256, 
sha512", 
-            errorcode=400
-        )
+        raise base.ASFQuartException(f"Invalid hash type '{hash_type}'. 
Supported types: sha256, sha512", errorcode=400)
 
     rel_path = pathlib.Path(file_path)
 
@@ -228,8 +225,7 @@ async def sbomgen(
     # Check that the file is a .tar.gz archive before creating a revision
     if not (file_path.endswith(".tar.gz") or file_path.endswith(".tgz")):
         raise base.ASFQuartException(
-            f"SBOM generation requires .tar.gz or .tgz files. Received: 
{file_path}",
-            errorcode=400
+            f"SBOM generation requires .tar.gz or .tgz files. Received: 
{file_path}", errorcode=400
         )
 
     try:
diff --git a/atr/routes/keys.py b/atr/routes/keys.py
index 0755c40..31770c4 100644
--- a/atr/routes/keys.py
+++ b/atr/routes/keys.py
@@ -497,15 +497,9 @@ async def _get_keys_text(keys_url: str, render: 
Callable[[str], Awaitable[str]])
                 response.raise_for_status()
                 return await response.text()
     except aiohttp.ClientResponseError as e:
-        raise base.ASFQuartException(
-                f"Unable to fetch keys from remote server: {e.status} 
{e.message}",
-                errorcode=502
-            )
+        raise base.ASFQuartException(f"Unable to fetch keys from remote 
server: {e.status} {e.message}", errorcode=502)
     except aiohttp.ClientError as e:
-        raise base.ASFQuartException(
-                f"Network error while fetching keys: {e}",
-                errorcode=503
-            )
+        raise base.ASFQuartException(f"Network error while fetching keys: 
{e}", errorcode=503)
 
 
 async def _key_and_is_owner(
diff --git a/atr/util.py b/atr/util.py
index 4e1fbf2..3909aba 100644
--- a/atr/util.py
+++ b/atr/util.py
@@ -926,10 +926,7 @@ def validate_as_type[T](value: Any, t: type[T]) -> T:
 async def validate_empty_form() -> None:
     empty_form = await forms.Empty.create_form(data=await quart.request.form)
     if not await empty_form.validate_on_submit():
-        raise base.ASFQuartException(
-            "Invalid form submission. Please check your input and try again.",
-            errorcode=400
-        )
+        raise base.ASFQuartException("Invalid form submission. Please check 
your input and try again.", errorcode=400)
 
 
 def validate_vote_duration(form: wtforms.Form, field: wtforms.IntegerField) -> 
None:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to