Add flake8-implicit-str-concat rules to Ruff (#33191)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2026-01-28 04:56:10 +00:00
committed by GitHub
parent a97b5e206d
commit 2eb673a088
16 changed files with 34 additions and 33 deletions

View File

@@ -193,7 +193,7 @@ TEST_CASES = [
pytest.param(
False,
"<|python_start|>[get_weather(city='LA', metric='C'), "
+ "register_user(name='Doe', age=9)]",
"register_user(name='Doe', age=9)]",
[
SIMPLE_FUNCTION_CALL,
FunctionCall(name="register_user", arguments='{"name": "Doe", "age": 9}'),

View File

@@ -24,9 +24,9 @@ def parser(deepseekv31_tokenizer):
def test_extract_tool_calls_with_tool(parser):
model_output = (
"normal text"
+ "<tool▁calls▁begin>"
+ '<tool▁call▁begin>foo<tool▁sep>{"x":1}<tool▁call▁end>'
+ "<tool▁calls▁end>"
"<tool▁calls▁begin>"
'<tool▁call▁begin>foo<tool▁sep>{"x":1}<tool▁call▁end>'
"<tool▁calls▁end>"
)
result = parser.extract_tool_calls(model_output, None)
assert result.tools_called
@@ -39,11 +39,11 @@ def test_extract_tool_calls_with_tool(parser):
def test_extract_tool_calls_with_multiple_tools(parser):
model_output = (
"some prefix text"
+ "<tool▁calls▁begin>"
+ '<tool▁call▁begin>foo<tool▁sep>{"x":1}<tool▁call▁end>'
+ '<tool▁call▁begin>bar<tool▁sep>{"y":2}<tool▁call▁end>'
+ "<tool▁calls▁end>"
+ " some suffix text"
"<tool▁calls▁begin>"
'<tool▁call▁begin>foo<tool▁sep>{"x":1}<tool▁call▁end>'
'<tool▁call▁begin>bar<tool▁sep>{"y":2}<tool▁call▁end>'
"<tool▁calls▁end>"
" some suffix text"
)
result = parser.extract_tool_calls(model_output, None)

View File

@@ -1302,7 +1302,7 @@ def prep_prompts(batch_size: int, ln_range: tuple[int, int] = (800, 1100)):
indices.append(idx)
prompt = (
"```python\n# We set a number of variables, "
+ f"x{idx} will be important later\n"
f"x{idx} will be important later\n"
)
ln = random.randint(*ln_range)
for k in range(30, ln):