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

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


The following commit(s) were added to refs/heads/sbp by this push:
     new 38ba32a  Fix unparenthesized subexpressions in all scripts
38ba32a is described below

commit 38ba32a32b37ae1652c071b15d3e9966bb4619c7
Author: Sean B. Palmer <[email protected]>
AuthorDate: Sun Feb 8 11:43:20 2026 +0000

    Fix unparenthesized subexpressions in all scripts
---
 scripts/check_models_imports.py | 4 ++--
 scripts/docs_post_process.py    | 4 ++--
 scripts/fix_order.py            | 2 +-
 scripts/github_tag_dates.py     | 2 +-
 scripts/interface_privacy.py    | 2 +-
 scripts/markup_strings.py       | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/check_models_imports.py b/scripts/check_models_imports.py
index 1045be8..271b969 100755
--- a/scripts/check_models_imports.py
+++ b/scripts/check_models_imports.py
@@ -44,7 +44,7 @@ def _check_file(path: pathlib.Path) -> list[str]:
         if isinstance(node, ast.Import):
             for alias in node.names:
                 root = alias.name.split(".")[0]
-                if not _is_stdlib(alias.name) and (root not in 
_ALLOWED_PACKAGES):
+                if (not _is_stdlib(alias.name)) and (root not in 
_ALLOWED_PACKAGES):
                     errors.append(f"{path}:{node.lineno}: disallowed import 
'{alias.name}'")
 
         elif isinstance(node, ast.ImportFrom):
@@ -55,7 +55,7 @@ def _check_file(path: pathlib.Path) -> list[str]:
                 # This should be unreachable
                 continue
             root = node.module.split(".")[0]
-            if not _is_stdlib(node.module) and (root not in _ALLOWED_PACKAGES):
+            if (not _is_stdlib(node.module)) and (root not in 
_ALLOWED_PACKAGES):
                 errors.append(f"{path}:{node.lineno}: disallowed import from 
'{node.module}'")
 
     return errors
diff --git a/scripts/docs_post_process.py b/scripts/docs_post_process.py
index bb165f4..15059c3 100644
--- a/scripts/docs_post_process.py
+++ b/scripts/docs_post_process.py
@@ -54,7 +54,7 @@ class HeadingProcessor(parser.HTMLParser):
             self.output.append(text)
 
     def handle_endtag(self, tag: str) -> None:
-        if self.in_heading and tag == self.heading_tag:
+        if self.in_heading and (tag == self.heading_tag):
             heading_id = self._generate_id(self.heading_content)
             self.output.append(f'<{self.heading_tag} id="{heading_id}">')
             self.output.append(self.heading_content)
@@ -100,7 +100,7 @@ def main() -> None:
 
     for file_arg in sys.argv[1:]:
         file_path = pathlib.Path(file_arg)
-        if file_path.exists() and file_path.suffix == ".html":
+        if file_path.exists() and (file_path.suffix == ".html"):
             process_html_file(file_path)
         else:
             print(f"Warning: {file_arg} not found or not an HTML file")
diff --git a/scripts/fix_order.py b/scripts/fix_order.py
index 13d3f27..9774f35 100755
--- a/scripts/fix_order.py
+++ b/scripts/fix_order.py
@@ -87,7 +87,7 @@ def _is_main_guard(block: list[str]) -> bool:
 
 
 def _normalise(block: list[str]) -> str:
-    while block and not block[-1].strip():
+    while block and (not block[-1].strip()):
         block = block[:-1]
     return "".join(block).rstrip("\n") + "\n"
 
diff --git a/scripts/github_tag_dates.py b/scripts/github_tag_dates.py
index f2263c8..df83346 100644
--- a/scripts/github_tag_dates.py
+++ b/scripts/github_tag_dates.py
@@ -49,7 +49,7 @@ query($owner:String!,$name:String!,$after:String){
 
 def repo_from_arg(a: str) -> tuple[str, str]:
     # Allow either owner/repo or owner repo
-    return (a.split("/", 1)[0], a.split("/", 1)[1]) if "/" in a else (a, 
sys.argv[2])
+    return (a.split("/", 1)[0], a.split("/", 1)[1]) if ("/" in a) else (a, 
sys.argv[2])
 
 
 def pick(node: dict) -> tuple[str, str, str] | None:
diff --git a/scripts/interface_privacy.py b/scripts/interface_privacy.py
index 783c498..7df4c03 100755
--- a/scripts/interface_privacy.py
+++ b/scripts/interface_privacy.py
@@ -98,7 +98,7 @@ def main() -> None:
     file_path = pathlib.Path(sys.argv[1])
     filename = str(file_path)
 
-    if not file_path.is_file() or (not filename.endswith(".py")):
+    if (not file_path.is_file()) or (not filename.endswith(".py")):
         print(f"!! {filename} - invalid file", file=sys.stderr)
         sys.exit(ExitCode.USAGE_ERROR)
 
diff --git a/scripts/markup_strings.py b/scripts/markup_strings.py
index db23fc7..a9a297f 100755
--- a/scripts/markup_strings.py
+++ b/scripts/markup_strings.py
@@ -91,7 +91,7 @@ def main() -> None:
     #     print(f"!! {filename} - ignored", file=sys.stderr)
     #     sys.exit(ExitCode.SUCCESS)
 
-    if not file_path.is_file() or (not filename.endswith(".py")):
+    if (not file_path.is_file()) or (not filename.endswith(".py")):
         print(f"!! {filename} - invalid file", file=sys.stderr)
         sys.exit(ExitCode.USAGE_ERROR)
 


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

Reply via email to