mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-18 21:21:05 +02:00
style: give Protocol stubs docstring bodies
Replace the `...` bodies in DocumentParser / StorageEngine protocol methods with one-line docstrings: silences the CodeQL "statement has no effect" false positives on #272 (`...` is idiomatic for typing.Protocol, but docstrings document the contract and don't trip the analyzer) with no behavior change. Claude-Session: https://claude.ai/code/session_01Kx5DgKbhK1N8autqXH8SmS
This commit is contained in:
parent
2a69c76b7f
commit
703017e581
2 changed files with 42 additions and 14 deletions
|
|
@ -24,5 +24,8 @@ class ParsedDocument:
|
|||
|
||||
@runtime_checkable
|
||||
class DocumentParser(Protocol):
|
||||
def supported_extensions(self) -> list[str]: ...
|
||||
def parse(self, file_path: str, **kwargs) -> ParsedDocument: ...
|
||||
def supported_extensions(self) -> list[str]:
|
||||
"""Return the file extensions this parser handles (e.g. ['.pdf'])."""
|
||||
|
||||
def parse(self, file_path: str, **kwargs) -> ParsedDocument:
|
||||
"""Parse a file into a ParsedDocument (a flat list of ContentNode)."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue