mirror of
https://github.com/searxng/searxng.git
synced 2024-11-25 12:21:00 +00:00
[enh] add test.yamllint - lint yaml files
Usage:: make test.yamllint ./manage test.yamllint test.yamllint is also added to the `test` makefile target. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
fb6dd416e5
commit
393c06f537
4 changed files with 30 additions and 3 deletions
16
.yamllint.yml
Normal file
16
.yamllint.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
|
||||||
|
indentation:
|
||||||
|
spaces: 2
|
||||||
|
|
||||||
|
# 120 chars should be enough, but don't fail if a line is longer
|
||||||
|
line-length:
|
||||||
|
max: 120
|
||||||
|
level: warning
|
||||||
|
allow-non-breakable-words: true
|
||||||
|
|
||||||
|
# we don't have multiple document per file
|
||||||
|
document-start: disable
|
||||||
|
document-end: disable
|
6
Makefile
6
Makefile
|
@ -51,8 +51,8 @@ search.checker.%: install
|
||||||
$(Q)./manage pyenv.cmd searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
|
$(Q)./manage pyenv.cmd searx-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
|
||||||
|
|
||||||
PHONY += test ci.test test.shell
|
PHONY += test ci.test test.shell
|
||||||
ci.test: test.pep8 test.pylint test.unit test.robot
|
ci.test: test.yamllint test.pep8 test.pylint test.unit test.robot
|
||||||
test: test.pep8 test.pylint test.unit test.robot test.shell
|
test: test.yamllint test.pep8 test.pylint test.unit test.robot test.shell
|
||||||
test.shell:
|
test.shell:
|
||||||
$(Q)shellcheck -x -s dash \
|
$(Q)shellcheck -x -s dash \
|
||||||
dockerfiles/docker-entrypoint.sh
|
dockerfiles/docker-entrypoint.sh
|
||||||
|
@ -81,7 +81,7 @@ MANAGE += node.env node.clean
|
||||||
MANAGE += py.build py.clean
|
MANAGE += py.build py.clean
|
||||||
MANAGE += pyenv pyenv.install pyenv.uninstall
|
MANAGE += pyenv pyenv.install pyenv.uninstall
|
||||||
MANAGE += pypi.upload pypi.upload.test
|
MANAGE += pypi.upload pypi.upload.test
|
||||||
MANAGE += test.pylint test.pep8 test.unit test.coverage test.robot test.clean
|
MANAGE += test.yamllint test.pylint test.pep8 test.unit test.coverage test.robot test.clean
|
||||||
MANAGE += themes.all themes.oscar themes.simple themes.bootstrap
|
MANAGE += themes.all themes.oscar themes.simple themes.bootstrap
|
||||||
|
|
||||||
PHONY += $(MANAGE)
|
PHONY += $(MANAGE)
|
||||||
|
|
10
manage
10
manage
|
@ -29,6 +29,11 @@ pylint.FILES() {
|
||||||
grep -l -r --include \*.py '^#[[:blank:]]*lint:[[:blank:]]*pylint' searx searx_extra tests
|
grep -l -r --include \*.py '^#[[:blank:]]*lint:[[:blank:]]*pylint' searx searx_extra tests
|
||||||
}
|
}
|
||||||
|
|
||||||
|
YAMLLINT_FILES=()
|
||||||
|
while IFS= read -r line; do
|
||||||
|
YAMLLINT_FILES+=("$line")
|
||||||
|
done <<< "$(git ls-files './tests/*.yml' './searx/*.yml')"
|
||||||
|
|
||||||
PYLINT_SEARX_DISABLE_OPTION="\
|
PYLINT_SEARX_DISABLE_OPTION="\
|
||||||
I,C,R,\
|
I,C,R,\
|
||||||
W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\
|
W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\
|
||||||
|
@ -391,6 +396,11 @@ pypi.upload.test() {
|
||||||
pyenv.cmd twine upload -r testpypi "${PYDIST}"/*
|
pyenv.cmd twine upload -r testpypi "${PYDIST}"/*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test.yamllint() {
|
||||||
|
build_msg TEST "[pylint] \$PYLINT_FILES"
|
||||||
|
pyenv.cmd yamllint --format parsable "${YAMLLINT_FILES[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
test.pylint() {
|
test.pylint() {
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
( set -e
|
( set -e
|
||||||
|
|
|
@ -16,3 +16,4 @@ sphinxcontrib-programoutput==0.17
|
||||||
sphinx-autobuild==2021.3.14
|
sphinx-autobuild==2021.3.14
|
||||||
linuxdoc==20210324
|
linuxdoc==20210324
|
||||||
aiounittest==1.4.0
|
aiounittest==1.4.0
|
||||||
|
yamllint==1.26.1
|
||||||
|
|
Loading…
Reference in a new issue