text-splitters: Add ruff rules FBT (#31935)

See [flake8-boolean-trap
(FBT)](https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt)
This commit is contained in:
Christophe Bornet
2025-07-10 00:36:58 +02:00
committed by GitHub
parent 4d9c0b0883
commit 060fc0e3c9
8 changed files with 37 additions and 27 deletions

View File

@@ -24,8 +24,8 @@ class MarkdownHeaderTextSplitter:
def __init__(
self,
headers_to_split_on: list[tuple[str, str]],
return_each_line: bool = False,
strip_headers: bool = True,
return_each_line: bool = False, # noqa: FBT001,FBT002
strip_headers: bool = True, # noqa: FBT001,FBT002
):
"""Create a new MarkdownHeaderTextSplitter.
@@ -279,8 +279,8 @@ class ExperimentalMarkdownSyntaxTextSplitter:
def __init__(
self,
headers_to_split_on: Union[list[tuple[str, str]], None] = None,
return_each_line: bool = False,
strip_headers: bool = True,
return_each_line: bool = False, # noqa: FBT001,FBT002
strip_headers: bool = True, # noqa: FBT001,FBT002
):
"""Initialize the text splitter with header splitting and formatting options.