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 d88c4b0f Skip files that use overloads when fixing function order
d88c4b0f is described below
commit d88c4b0fa4611d6bee32f6be9ac85f8278e9cc72
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Feb 26 20:26:01 2026 +0000
Skip files that use overloads when fixing function order
---
scripts/fix_order.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/fix_order.py b/scripts/fix_order.py
index 9c2c33c6..635d1df2 100755
--- a/scripts/fix_order.py
+++ b/scripts/fix_order.py
@@ -42,6 +42,8 @@ def main() -> None:
count = _count_defs(lines)
if count > 1:
sys.exit(f"{path}:{lineno}: multiple function definitions in
block")
+ if _has_overload(lines):
+ sys.exit(f"{path}:{lineno}: @overload requires manual ordering")
if _is_func(lines):
seen_func = True
func.append((lineno, lines))
@@ -80,6 +82,10 @@ def _count_defs(block: list[str]) -> int:
return sum(1 for line in block if line.startswith(("def ", "async def ")))
+def _has_overload(block: list[str]) -> bool:
+ return any((line.strip() == "@overload") for line in block)
+
+
def _is_func(block: list[str]) -> bool:
for line in block:
if not line.strip():
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]