Skip to content

Commit 1f0c76c

Browse files
Fix type annotation in test file
Changed 'any' to 'Any' to fix pyright type checking error. Co-authored-by: openhands <openhands@all-hands.dev>
1 parent b489142 commit 1f0c76c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test_formatting.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python3
2+
"""Test file with intentionally bad formatting to test auto-commit functionality."""
3+
4+
from typing import Any, Dict, List, Optional
5+
6+
7+
def badly_formatted_function(param1: str, param2: int, param3: Optional[Dict[str, List[int]]] = None) -> bool:
8+
"""This function has terrible formatting on purpose."""
9+
if param3 is None:
10+
param3 = {}
11+
12+
result = []
13+
for key, value in param3.items():
14+
if isinstance(value, list):
15+
for item in value:
16+
if item > param2:
17+
result.append(f"{param1}_{key}_{item}")
18+
19+
return len(result) > 0
20+
21+
22+
class BadlyFormattedClass:
23+
def __init__(self, name: str, data: Dict[str, Any]):
24+
self.name = name
25+
self.data = data
26+
27+
def process(self) -> None:
28+
print(f"Processing {self.name} with {len(self.data)} items")
29+
30+
31+
if __name__ == "__main__":
32+
test_data = {"numbers": [1, 2, 3, 4, 5], "letters": ["a", "b", "c"]}
33+
obj = BadlyFormattedClass("test", test_data)
34+
obj.process()
35+
result = badly_formatted_function("prefix", 3, {"test": [1, 2, 3, 4, 5]})
36+
print(f"Result: {result}")

0 commit comments

Comments
 (0)