Skip to content

Commit cfbc14a

Browse files
committed
Update pre-commit checks
1 parent 4da60ee commit cfbc14a

File tree

9 files changed

+19
-21
lines changed

9 files changed

+19
-21
lines changed

eval/packs/google_adk_memory_eval.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@
102102
}
103103
],
104104
"creation_timestamp": 1747340865.704361
105-
}
105+
}

eval/packs/superoptix_qa_pairs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,3 @@
5050
"category": "ML"
5151
}
5252
]
53-

rlm_code/models/code_generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def calculator_tool(expression: str) -> str:
152152
"""Evaluate simple mathematical expressions safely."""
153153
import ast
154154
import operator
155-
155+
156156
# Safe operators for basic math
157157
ops = {{
158158
ast.Add: operator.add,
@@ -162,7 +162,7 @@ def calculator_tool(expression: str) -> str:
162162
ast.Pow: operator.pow,
163163
ast.USub: operator.neg,
164164
}}
165-
165+
166166
def safe_eval(node):
167167
if isinstance(node, ast.Constant):
168168
return node.value
@@ -172,7 +172,7 @@ def safe_eval(node):
172172
return ops[type(node.op)](safe_eval(node.operand))
173173
else:
174174
raise ValueError(f"Unsupported operation")
175-
175+
176176
try:
177177
tree = ast.parse(expression, mode='eval')
178178
result = safe_eval(tree.body)

tests/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def sample_dspy_signature_code():
4040
4141
class SentimentAnalysis(dspy.Signature):
4242
"""Analyze the sentiment of text."""
43-
43+
4444
text = dspy.InputField(desc="The text to analyze")
4545
sentiment = dspy.OutputField(desc="The sentiment: positive, negative, or neutral")
4646
'''
@@ -58,11 +58,11 @@ class SentimentSignature(dspy.Signature):
5858
5959
class SentimentModule(dspy.Module):
6060
"""A module for sentiment analysis."""
61-
61+
6262
def __init__(self):
6363
super().__init__()
6464
self.predictor = dspy.Predict(SentimentSignature)
65-
65+
6666
def forward(self, text):
6767
"""Analyze the sentiment of the given text."""
6868
return self.predictor(text=text)

tests/fixtures/rlm_ci_baseline_generic_smoke.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@
3131
}
3232
]
3333
}
34-

tests/rlm/test_phase3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ def test_benchmark_cases_have_pure_rlm_env(self):
370370
for preset in ["oolong_style", "browsecomp_style", "token_efficiency"]:
371371
cases = get_benchmark_cases(preset)
372372
for case in cases:
373-
assert case.environment == "pure_rlm", (
374-
f"{preset}/{case.case_id} should use pure_rlm"
375-
)
373+
assert (
374+
case.environment == "pure_rlm"
375+
), f"{preset}/{case.case_id} should use pure_rlm"
376376

377377
def test_benchmark_cases_have_reasonable_timeouts(self):
378378
"""Test that paper benchmarks have appropriate timeouts."""

tests/test_property_validators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_valid_signature_passes_validation(
8080
8181
class {class_name}(dspy.Signature):
8282
"""{docstring}"""
83-
83+
8484
{input_field_name} = dspy.InputField(desc="{input_desc}")
8585
{output_field_name} = dspy.OutputField(desc="{output_desc}")
8686
'''
@@ -137,11 +137,11 @@ class {signature_name}(dspy.Signature):
137137
138138
class {module_name}(dspy.Module):
139139
"""{docstring}"""
140-
140+
141141
def __init__(self):
142142
super().__init__()
143143
self.predictor = dspy.Predict({signature_name})
144-
144+
145145
def forward(self, {input_field}):
146146
"""Execute the task."""
147147
return self.predictor({input_field}={input_field})

tests/test_retry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ def failing_operation():
8383
with pytest.raises(ValueError):
8484
controller.execute_sync_with_retry(failing_operation, "test_op")
8585

86-
assert attempt_count == max_attempts, (
87-
f"Expected {max_attempts} attempts, got {attempt_count}"
88-
)
86+
assert (
87+
attempt_count == max_attempts
88+
), f"Expected {max_attempts} attempts, got {attempt_count}"
8989

9090
@pytest.mark.asyncio
9191
async def test_async_retry_respects_max_attempts(self):

tests/test_security_validator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,6 @@ class MockConfig:
209209
validator = SecurityValidator()
210210

211211
# Check module code (where calculator_tool is defined)
212-
assert not validator.has_eval(program.module_code), (
213-
f"Generated module code should not contain eval():\n{program.module_code}"
214-
)
212+
assert not validator.has_eval(
213+
program.module_code
214+
), f"Generated module code should not contain eval():\n{program.module_code}"

0 commit comments

Comments
 (0)