mirror of
https://github.com/searxng/searxng.git
synced 2024-06-02 13:29:22 +00:00
86b4d2f2d0
We have been using a static type checker (pyright) for a long time, but its check was not yet a prerequisite for passing the quality gate. It was checked in the CI, but the error messages were only logged. As is always the case in life, with checks that you have to do but which have no consequences; you neglect them :-) We didn't activate the checks back then because we (even today) have too much monkey patching in our code (not only in the engines, httpx and others objects are also affected). We want to replace monkey patching with clear interfaces for a long time, the basis for this is increased typing and we can only achieve this if we make type checking an integral part of the quality gate. This PR activates the type check; in order to pass the check, a few typings were corrected in the code, but most type inconsistencies were deactivated via inline comments. This was particularly necessary in places where the code uses properties that stick to the objects (monkey patching). The sticking of properties only happens in a few places, but the access to these properties extends over the entire code, which is why there are many `# type: ignore` markers in the code ... which we will hopefully be able to remove again successively in the future. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
103 lines
2.8 KiB
Makefile
103 lines
2.8 KiB
Makefile
# -*- coding: utf-8; mode: makefile-gmake -*-
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
.DEFAULT_GOAL=help
|
|
export MTOOLS=./manage
|
|
|
|
include utils/makefile.include
|
|
|
|
all: clean install
|
|
|
|
PHONY += help
|
|
|
|
help:
|
|
@./manage --help
|
|
@echo '----'
|
|
@echo 'run - run developer instance'
|
|
@echo 'install - developer install of SearxNG into virtualenv'
|
|
@echo 'uninstall - uninstall developer installation'
|
|
@echo 'clean - clean up working tree'
|
|
@echo 'search.checker - check search engines'
|
|
@echo 'test - run shell & CI tests'
|
|
@echo 'test.shell - test shell scripts'
|
|
@echo 'ci.test - run CI tests'
|
|
|
|
|
|
PHONY += run
|
|
run: install
|
|
$(Q)./manage webapp.run
|
|
|
|
PHONY += install uninstall
|
|
install uninstall:
|
|
$(Q)./manage pyenv.$@
|
|
|
|
PHONY += clean
|
|
clean: py.clean docs.clean node.clean nvm.clean test.clean
|
|
$(Q)./manage build_msg CLEAN "common files"
|
|
$(Q)find . -name '*.orig' -exec rm -f {} +
|
|
$(Q)find . -name '*.rej' -exec rm -f {} +
|
|
$(Q)find . -name '*~' -exec rm -f {} +
|
|
$(Q)find . -name '*.bak' -exec rm -f {} +
|
|
|
|
lxc.clean:
|
|
$(Q)rm -rf lxc-env
|
|
|
|
PHONY += search.checker search.checker.%
|
|
search.checker: install
|
|
$(Q)./manage pyenv.cmd searxng-checker -v
|
|
|
|
search.checker.%: install
|
|
$(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
|
|
|
|
PHONY += test ci.test test.shell
|
|
ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.pybabel
|
|
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
|
|
$(Q)shellcheck -x -s bash \
|
|
utils/brand.sh \
|
|
$(MTOOLS) \
|
|
utils/lib.sh \
|
|
utils/lib_sxng*.sh \
|
|
utils/lib_go.sh \
|
|
utils/lib_nvm.sh \
|
|
utils/lib_redis.sh \
|
|
utils/searxng.sh \
|
|
utils/lxc.sh \
|
|
utils/lxc-searxng.env \
|
|
utils/searx.sh \
|
|
utils/filtron.sh \
|
|
utils/morty.sh
|
|
$(Q)$(MTOOLS) build_msg TEST "[shellcheck] $@ OK"
|
|
|
|
|
|
# wrap ./manage script
|
|
|
|
MANAGE += weblate.translations.commit weblate.push.translations
|
|
MANAGE += data.all data.traits data.useragents data.locales
|
|
MANAGE += docs.html docs.live docs.gh-pages docs.prebuild docs.clean
|
|
MANAGE += docker.build docker.push docker.buildx
|
|
MANAGE += gecko.driver
|
|
MANAGE += node.env node.env.dev node.clean
|
|
MANAGE += py.build py.clean
|
|
MANAGE += pyenv pyenv.install pyenv.uninstall
|
|
MANAGE += format.python
|
|
MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean
|
|
MANAGE += themes.all themes.simple themes.simple.test pygments.less
|
|
MANAGE += static.build.commit static.build.drop static.build.restore
|
|
MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs
|
|
|
|
PHONY += $(MANAGE)
|
|
|
|
$(MANAGE):
|
|
$(Q)$(MTOOLS) $@
|
|
|
|
# short hands of selected targets
|
|
|
|
PHONY += docs docker themes
|
|
|
|
docs: docs.html
|
|
docker: docker.build
|
|
themes: themes.all
|