fix: modernize docstring types (List → list, Optional → X | None) to match signatures; regenerate lib/MCP docs (pydoclint zero)

This commit is contained in:
2026-09-13 16:21:09 +05:30
parent 14d89f5f91
commit cd06de5435
46 changed files with 187 additions and 99 deletions

View File

@@ -63,7 +63,7 @@ class BaseScraper(ABC):
source (str):
Location identifier (URL, file path, S3 URI, etc.).
metadata (Optional[Mapping[str, Any]], optional):
metadata (Mapping[str, Any] | None, optional):
Optional hints for the scraper (headers, auth, etc.).
Returns:

View File

@@ -59,7 +59,7 @@ class CsvParser(CsvParserBase[list[list[str]]]):
Parse the document into normalized string rows.
Returns:
List[List[str]]:
list[list[str]]:
Rows of the document.
"""
return self.rows()
@@ -74,7 +74,7 @@ class CsvParser(CsvParserBase[list[list[str]]]):
omitted.
Returns:
List[List[str]]:
list[list[str]]:
Normalized rows; trailing blank cells are trimmed per row.
"""
text = self._decode(self.content.raw)

View File

@@ -59,7 +59,7 @@ class CsvScraper:
source (Any):
Identifier of the csv source as understood by the
configured client.
metadata (Optional[Mapping[str, Any]], optional):
metadata (Mapping[str, Any] | None, optional):
Optional metadata to attach to the returned content.
Returns:

View File

@@ -126,7 +126,7 @@ class HTMLParser(BaseParser[T], Generic[T]):
BeautifulSoup tag representing an anchor.
Returns:
Optional[str]:
str | None:
The value of the `href` attribute, or None if absent.
"""
return a.get("href")

View File

@@ -64,7 +64,7 @@ class HTMLScraper(BaseScraper):
Optional pre-configured `httpx.Client`. If omitted, a client is created internally.
timeout (float, optional):
Request timeout in seconds.
headers (Optional[Mapping[str, str]], optional):
headers (Mapping[str, str] | None, optional):
Optional default HTTP headers.
follow_redirects (bool, optional):
Whether to follow HTTP redirects.
@@ -113,7 +113,7 @@ class HTMLScraper(BaseScraper):
Args:
source (str):
URL of the HTML document.
metadata (Optional[Mapping[str, Any]], optional):
metadata (Mapping[str, Any] | None, optional):
Optional metadata to be merged into the returned content.
Returns:

View File

@@ -57,7 +57,7 @@ class PDFScraper(BaseScraper):
Args:
source (Any):
Identifier of the PDF source as understood by the configured PDF client.
metadata (Optional[Mapping[str, Any]], optional):
metadata (Mapping[str, Any] | None, optional):
Optional metadata to attach to the returned content.
Returns:

View File

@@ -87,7 +87,7 @@ class XlsxParser(XlsxParserBase[list[list[str]]]):
Parse the first worksheet into normalized string rows.
Returns:
List[List[str]]:
list[list[str]]:
Rows of the default (first) worksheet.
"""
return self.rows()
@@ -102,13 +102,13 @@ class XlsxParser(XlsxParserBase[list[list[str]]]):
Extract normalized string rows from a worksheet.
Args:
sheet (Optional[Union[int, str]]):
sheet (int | str | None):
Worksheet index or title; defaults to the first worksheet.
skip_empty (bool):
When True (default), rows whose cells are all blank are omitted.
Returns:
List[List[str]]:
list[list[str]]:
Normalized rows; trailing blank cells are trimmed per row.
Raises:

View File

@@ -58,7 +58,7 @@ class XlsxScraper:
source (Any):
Identifier of the spreadsheet source as understood by the
configured client.
metadata (Optional[Mapping[str, Any]], optional):
metadata (Mapping[str, Any] | None, optional):
Optional metadata to attach to the returned content.
Returns: