From 96450b17d4304a740c0af934cbb841de67178d94 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Thu, 20 Jan 2022 08:26:16 +0100 Subject: [PATCH] [mod] add test.pyright to test & ci.test targets Since we currently have many type checking errors, we for now only test with typeCheckingMode: off which makes pyright only check files that contain a comment: # pyright: basic to enable basic type checking, or # pyright: strict to enable strict type checking. --- Makefile | 4 ++-- manage | 2 +- pyrightconfig-ci.json | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 pyrightconfig-ci.json diff --git a/Makefile b/Makefile index 3f46d109..0c0ec6c0 100644 --- a/Makefile +++ b/Makefile @@ -50,8 +50,8 @@ search.checker.%: install $(Q)./manage pyenv.cmd searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))" PHONY += test ci.test test.shell -ci.test: test.yamllint test.black test.pylint test.unit test.robot test.rst -test: test.yamllint test.black test.pylint test.unit test.robot test.rst test.shell +ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst +test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.shell test.shell: $(Q)shellcheck -x -s dash \ dockerfiles/docker-entrypoint.sh diff --git a/manage b/manage index 0c0e851c..aec3906d 100755 --- a/manage +++ b/manage @@ -689,7 +689,7 @@ test.pyright() { nodejs.ensure # We run Pyright in the virtual environment because Pyright # executes "python" to determine the Python version. - pyenv.cmd pyright + pyenv.cmd pyright -p pyrightconfig-ci.json dump_return $? } diff --git a/pyrightconfig-ci.json b/pyrightconfig-ci.json new file mode 100644 index 00000000..9082b079 --- /dev/null +++ b/pyrightconfig-ci.json @@ -0,0 +1,10 @@ +{ + "venvPath": "local", + "venv": "py3", + "include": [ + "searx", + "searxng_extra", + "tests" + ], + "typeCheckingMode": "off" +}