haystack/pyproject.toml
Sara Zan 8de1aa3e43
Pylint: solve or silence locally rare warnings (#2170)
* Remove invalid-envvar-default and logging-too-many-args

* Remove import-self, access-member-before-definition and deprecated-argument

* Remove used-before-assignment by restructuring type import

* Remove unneeded-not

* Silence unnecessary-lambda (it's necessary)

* Remove pointless-string-statement

* Update Documentation & Code Style

* Silenced unsupported-membership-test (probably a real bug, can't fix though)

* Remove trailing-newlines

* Remove super-init-not-called and slience invalid-sequence-index (it's valid)

* Remove invalid-envvar-default in ui

* Remove some more warnings from pyproject.toml than actually solrted in code, CI will fail

* Linting all modules together is more readable

* Update Documentation & Code Style

* Typo in pylint disable comment

* Simplify long boolean statement

* Simplify init call in FAISS

* Fix inconsistent-return-statements

* Fix useless-super-delegation

* Fix useless-else-on-loop

* Fix another inconsistent-return-statements

* Move back pylint disable comment moved by black

* Fix consider-using-set-comprehension

* Fix another consider-using-set-comprehension

* Silence non-parent-init-called

* Update pylint exclusion list

* Update Documentation & Code Style

* Resolve unnecessary-else-after-break

* Fix superfluous-parens

* Fix no-else-break

* Remove is_correctly_retrieved along with its pylint issue

* Update exclusions list

* Silence constructor issue in squad_data.py (method is already broken)

* Fix too-many-return-statements

* Fix use-dict-literal

* Fix consider-using-from-import and useless-object-inheritance

* Update exclusion list

* Fix simplifiable-if-statements

* Fix one consider-using-dict-items

* Fix another consider-using-dict-items

* Fix a third consider-using-dict-items

* Fix last consider-using-dict-items

* Fix three use-a-generator

* Silence import errors on numba, tensorboardX and apex, but add comments & logs

* Fix couple of mypy issues

* Fix another typing issue

* Silence mypy, was conflicting with more meaningful pylint issue

* Fix no-else-continue

* Silence unsubscriptable-object and fix an import error with importlib.metadata

* Update Documentation & Code Style

* Fix all no-else-raise

* Update Documentation & Code Style

* Fix inverted parameters in simplified if switch

* Change [test] to [all] in some jobs (for typing and linting)

* Add comment in haystack/schema.py on pydantic's dataclasses

* Move comment from get_documents_by_id into _convert_weaviate_result_to_document in weaviate.py

* Add comment on pylint silencing

* Fix bug introduced rest_api/controller/search.py

* Update Documentation & Code Style

* Add ADR about Pydantic dataclasses

* Update pydantic-dataclasses.md

* Add link to Pydantic docs on Dataclasses

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-21 20:16:14 +01:00

105 lines
2.5 KiB
TOML

[build-system]
requires = [
"setuptools",
"wheel",
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120
[tool.pylint.'MESSAGES CONTROL']
max-line-length=120
disable = [
# Warnings
"fixme",
# Info
"c-extension-no-member",
"missing-docstring",
"unused-argument",
"no-member",
"line-too-long",
"protected-access",
"too-few-public-methods",
"raise-missing-from",
"invalid-name",
"logging-fstring-interpolation",
"wrong-import-position",
"too-many-locals",
"duplicate-code",
"too-many-arguments",
"arguments-differ",
"wrong-import-order",
"consider-using-f-string",
"no-else-return",
"unused-variable",
"attribute-defined-outside-init",
"too-many-instance-attributes",
"no-self-use",
"super-with-arguments",
"anomalous-backslash-in-string",
"redefined-builtin",
"logging-format-interpolation",
"f-string-without-interpolation",
"abstract-method",
"too-many-branches",
"trailing-whitespace",
"unspecified-encoding",
"unidiomatic-typecheck",
"no-name-in-module",
"dangerous-default-value",
"unused-import",
"consider-using-with",
"redefined-outer-name",
"cyclic-import",
"arguments-renamed",
"unnecessary-pass",
"ungrouped-imports",
"broad-except",
"unnecessary-comprehension",
"subprocess-run-check",
"singleton-comparison",
"import-outside-toplevel",
"consider-iterating-dictionary",
"too-many-nested-blocks",
"undefined-loop-variable",
"too-many-statements",
"consider-using-in",
"bare-except",
"too-many-lines",
"unexpected-keyword-arg",
"simplifiable-if-expression",
"use-list-literal",
"reimported",
"deprecated-method",
]
[tool.pylint.'DESIGN']
max-args=7
[tool.pylint.'SIMILARITIES']
min-similarity-lines=6
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--strict-markers"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"tika: marks tests which require tika container (deselect with '-m \"not tika\"')",
"elasticsearch: marks tests which require elasticsearch container (deselect with '-m \"not elasticsearch\"')",
"graphdb: marks tests which require graphdb container (deselect with '-m \"not graphdb\"')",
"generator: marks generator tests (deselect with '-m \"not generator\"')",
"pipeline: marks tests with pipeline",
"summarizer: marks summarizer tests",
"weaviate: marks tests that require weaviate container",
"embedding_dim: marks usage of document store with non-default embedding dimension (e.g @pytest.mark.embedding_dim(128))",
]
log_cli = true