[CI] Ignore ruff D209, rejoin the docstrings it split, and silence incompatible-rule warnings (#57212)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-16 10:57:24 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent 1085b64425
commit 651a88c09a
693 changed files with 2088 additions and 4171 deletions
+9 -18
View File
@@ -416,8 +416,7 @@ def test_tool_call(
def test_empty_tool_call_block(body: str, lfm2_tokenizer: TokenizerLike):
"""An empty block ([] or [ ]) means the model called no tools; it must
not report tools_called=True with zero tool calls (the invariant
run_tool_extraction asserts).
"""
run_tool_extraction asserts)."""
cls = ToolParserManager.get_tool_parser("lfm2")
model_output = f"{TOOL_CALL_START}[{body}]{TOOL_CALL_END}"
@@ -437,8 +436,7 @@ def test_whitespace_after_start_token(lfm2_tokenizer: TokenizerLike):
not break parsing. The streaming path used to feed the indented text to
ast.parse verbatim, so every completion candidate raised
IndentationError and the call was silently dropped (non-streaming
stripped it and succeeded).
"""
stripped it and succeeded)."""
cls = ToolParserManager.get_tool_parser("lfm2")
model_output = f"{TOOL_CALL_START} [{SIMPLE_FUNCTION_OUTPUT}]{TOOL_CALL_END}"
@@ -478,8 +476,7 @@ def test_streaming_full_block_and_trailing_in_single_delta(
):
"""The entire <|tool_call_start|>[...]<|tool_call_end|> block plus
trailing assistant text arrive in one delta. Trailing content must
still be emitted — not silently dropped.
"""
still be emitted — not silently dropped."""
tool_parser: ToolParser = ToolParserManager.get_tool_parser("lfm2")(lfm2_tokenizer)
full_text = f"{TOOL_CALL_START}[{SIMPLE_FUNCTION_OUTPUT}]{TOOL_CALL_END}\nDone."
@@ -494,8 +491,7 @@ def test_streaming_leading_content_and_full_block_in_single_delta(
lfm2_tokenizer: TokenizerLike,
):
"""Leading assistant text plus the entire tool block arrive in one
delta. Leading content must be emitted — not silently dropped.
"""
delta. Leading content must be emitted — not silently dropped."""
tool_parser: ToolParser = ToolParserManager.get_tool_parser("lfm2")(lfm2_tokenizer)
full_text = (
f"Let me check. {TOOL_CALL_START}[{SIMPLE_FUNCTION_OUTPUT}]{TOOL_CALL_END}"
@@ -512,8 +508,7 @@ def test_streaming_leading_block_and_trailing_in_single_delta(
lfm2_tokenizer: TokenizerLike,
):
"""Leading text + complete tool block + trailing text in one delta.
Both leading and trailing content must be preserved.
"""
Both leading and trailing content must be preserved."""
tool_parser: ToolParser = ToolParserManager.get_tool_parser("lfm2")(lfm2_tokenizer)
full_text = (
"Let me check. "
@@ -534,8 +529,7 @@ def test_echoed_tool_call_body_not_leaked_to_content(
"""LFM2 sometimes emits the tool call body again after the first
<|tool_call_end|>, capped with a second <|tool_call_end|>. The
echoed body must not surface as assistant content — neither in
streaming nor non-streaming paths.
"""
streaming nor non-streaming paths."""
tool_parser: ToolParser = ToolParserManager.get_tool_parser("lfm2")(lfm2_tokenizer)
body = (
"[grocery.orderIngredients("
@@ -570,8 +564,7 @@ def test_streaming_char_by_char_multi_dict_list(lfm2_tokenizer: TokenizerLike):
character at a time. Every prefix lands in some partial-parse state
(mid-key, mid-value, open quote inside dict, empty dict, etc.). The
parser must not raise — incomplete prefixes should silently wait for
more text instead of logging exceptions.
"""
more text instead of logging exceptions."""
tool_parser: ToolParser = ToolParserManager.get_tool_parser("lfm2")(lfm2_tokenizer)
full_text = (
f"{TOOL_CALL_START}[grocery.orderIngredients("
@@ -602,8 +595,7 @@ def test_streaming_char_by_char_multi_dict_list(lfm2_tokenizer: TokenizerLike):
def test_streaming_dotted_name_in_single_delta(lfm2_tokenizer: TokenizerLike):
"""A pythonic call with a dotted/attribute function name (e.g.
``domain.method(arg=...)``) must be parsed correctly in streaming mode
just as in non-streaming mode.
"""
just as in non-streaming mode."""
tool_parser: ToolParser = ToolParserManager.get_tool_parser("lfm2")(lfm2_tokenizer)
full_text = f"{TOOL_CALL_START}[{DOTTED_NAME_FUNCTION_OUTPUT}]{TOOL_CALL_END}"
@@ -619,8 +611,7 @@ def test_adjust_request_disables_skip_special_tokens(
"""When tools are present, the parser must force
``skip_special_tokens=False`` so the engine does not strip the
<|tool_call_start|>/<|tool_call_end|> sentinels before they reach the
parser.
"""
parser."""
from vllm.entrypoints.openai.chat_completion.protocol import (
ChatCompletionRequest,
)