Skip to content
Snippets Groups Projects
Unverified Commit f8511acb authored by Ming's avatar Ming Committed by GitHub
Browse files

chore: + the linter `mypy` as a pre-commit hook (#9791)

parent 0a872ee1
No related branches found
No related tags found
No related merge requests found
...@@ -34,6 +34,20 @@ repos: ...@@ -34,6 +34,20 @@ repos:
name: black-src name: black-src
alias: black alias: black
exclude: ^(docs/|llama_index/_static) exclude: ^(docs/|llama_index/_static)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
hooks:
- id: mypy
additional_dependencies:
[
"types-requests",
"types-Deprecated",
"types-redis",
"types-setuptools",
"types-PyYAML",
"types-protobuf",
]
exclude: ^(docs/|llama_index/_static)
- repo: https://github.com/psf/black-pre-commit-mirror - repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1 rev: 23.10.1
hooks: hooks:
......
...@@ -25,7 +25,9 @@ class Pooling(str, Enum): ...@@ -25,7 +25,9 @@ class Pooling(str, Enum):
@classmethod @classmethod
@overload @overload
def cls_pooling(cls, array: "torch.Tensor") -> "torch.Tensor": # TODO: Remove this `type: ignore` after the false positive problem
# is addressed in mypy: https://github.com/python/mypy/issues/15683 .
def cls_pooling(cls, array: "torch.Tensor") -> "torch.Tensor": # type: ignore
... ...
@classmethod @classmethod
......
...@@ -87,6 +87,7 @@ def elasticsearch_connection() -> Union[dict, Generator[dict, None, None]]: ...@@ -87,6 +87,7 @@ def elasticsearch_connection() -> Union[dict, Generator[dict, None, None]]:
if index_name.startswith("test_"): if index_name.startswith("test_"):
es.indices.delete(index=index_name) es.indices.delete(index=index_name)
es.indices.refresh(index="_all") es.indices.refresh(index="_all")
return {}
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment