diff options
| author | Martin Fischer <martin@push-f.com> | 2022-01-24 08:02:00 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-24 08:02:00 +0100 |
| commit | 1f15d50aace578a63433a2b60c18ceb73dfa6230 (patch) | |
| tree | 08c1d2c49fbc9354322932e8d5d4bee8140b4bba /manage | |
| parent | 61853aa0fbcd2573f50e9c092f61cde1ad71492a (diff) | |
| parent | 309147d86f08f69ce1467aa4d25d3d6a56b2bc46 (diff) | |
Merge pull request #783 from not-my-profile/pyrightconfig.json
[enh] add pyrightconfig.json and integrate pyright into CI
Diffstat (limited to 'manage')
| -rwxr-xr-x | manage | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -20,6 +20,8 @@ source "$(dirname "${BASH_SOURCE[0]}")/utils/lib_go.sh" # shellcheck source=utils/lib_redis.sh source "$(dirname "${BASH_SOURCE[0]}")/utils/lib_redis.sh" +PATH="${REPO_ROOT}/node_modules/.bin:${PATH}" + # config PYOBJECTS="searx" @@ -103,6 +105,7 @@ format.: test.: yamllint : lint YAML files (YAMLLINT_FILES) pylint : lint PYLINT_FILES, searx/engines, searx & tests + pyright : static type check of python sources black : check black code format unit : run unit tests coverage : run unit tests with coverage @@ -558,6 +561,12 @@ node.env() { dump_return $? } +node.env.devtools() { + nodejs.ensure + build_msg INSTALL "package.json: developer and CI tools" + npm install +} + node.clean() { if ! required_commands npm 2>/dev/null; then build_msg CLEAN "npm is not installed / ignore npm dependencies" @@ -682,6 +691,16 @@ test.pylint() { dump_return $? } +test.pyright() { + build_msg TEST "[pyright] static type check of python sources" + node.env.devtools + # We run Pyright in the virtual environment because Pyright + # executes "python" to determine the Python version. + pyenv.cmd npx --no-install pyright -p pyrightconfig-ci.json + dump_return $? +} + + test.black() { build_msg TEST "[black] \$BLACK_TARGETS" pyenv.cmd black --check --diff "${BLACK_OPTIONS[@]}" "${BLACK_TARGETS[@]}" |