Chore(mypy): Annotate None returns for typing improvements (#11213)

This commit is contained in:
Sebastian Steinbeißer
2026-02-02 17:44:12 +01:00
committed by GitHub
parent a9c0b06e28
commit 3b5ffbf9fa
113 changed files with 1598 additions and 1510 deletions

View File

@@ -7,7 +7,7 @@ from paperless_tika.signals import tika_consumer_declaration
class PaperlessTikaConfig(AppConfig):
name = "paperless_tika"
def ready(self):
def ready(self) -> None:
from documents.signals import document_consumer_declaration
if settings.TIKA_ENABLED:

View File

@@ -53,7 +53,7 @@ class TikaDocumentParser(DocumentParser):
)
return []
def parse(self, document_path: Path, mime_type: str, file_name=None):
def parse(self, document_path: Path, mime_type: str, file_name=None) -> None:
self.log.info(f"Sending {document_path} to Tika server")
try:

View File

@@ -26,7 +26,7 @@ class TestTikaParserAgainstServer:
self,
tika_parser: TikaDocumentParser,
sample_odt_file: Path,
):
) -> None:
"""
GIVEN:
- An input ODT format document
@@ -55,7 +55,7 @@ class TestTikaParserAgainstServer:
self,
tika_parser: TikaDocumentParser,
sample_docx_file: Path,
):
) -> None:
"""
GIVEN:
- An input DOCX format document
@@ -87,7 +87,7 @@ class TestTikaParserAgainstServer:
self,
tika_parser: TikaDocumentParser,
sample_doc_file: Path,
):
) -> None:
"""
GIVEN:
- An input DOC format document
@@ -114,7 +114,7 @@ class TestTikaParserAgainstServer:
self,
tika_parser: TikaDocumentParser,
sample_broken_odt: Path,
):
) -> None:
"""
GIVEN:
- An input ODT format document

View File

@@ -20,7 +20,7 @@ class TestTikaParser:
settings: SettingsWrapper,
tika_parser: TikaDocumentParser,
sample_odt_file: Path,
):
) -> None:
settings.TIME_ZONE = "America/Chicago"
# Pretend parse response
httpx_mock.add_response(
@@ -53,7 +53,7 @@ class TestTikaParser:
httpx_mock: HTTPXMock,
tika_parser: TikaDocumentParser,
sample_odt_file: Path,
):
) -> None:
httpx_mock.add_response(
json={
"Content-Type": "application/vnd.oasis.opendocument.text",
@@ -76,7 +76,7 @@ class TestTikaParser:
httpx_mock: HTTPXMock,
tika_parser: TikaDocumentParser,
sample_odt_file: Path,
):
) -> None:
"""
GIVEN:
- Document needs to be converted to PDF
@@ -108,7 +108,7 @@ class TestTikaParser:
settings: SettingsWrapper,
tika_parser: TikaDocumentParser,
sample_odt_file: Path,
):
) -> None:
"""
GIVEN:
- Document needs to be converted to PDF