diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9bfee549b71ed2d8c3691fe9b8780f0c90e2c6e..8c74a3822fd99467ae151f7e42cd346a6c91fcb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: . ./ci-support-v0 build_py_project_in_conda_env python -m pip install mypy - python -m mypy "$(basename $GITHUB_REPOSITORY)" test + ./run-mypy.sh pytest3: name: Pytest Conda Py3 diff --git a/.gitignore b/.gitignore index 1857403580cec0f3b94131e261a31dd777b30897..57d18f0f2b470c6d9076d55d310150efc9dba424 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ a.out .pytest_cache test/nodal-dg + +.pylintrc.yml +.run-pylint.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e596fd7165a08eb2daf82eb6b3fef777f6c6b71d..7b60234eb7609ccc4ed242351cce88f14217b4ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -96,7 +96,7 @@ Mypy: . ./ci-support-v0 build_py_project_in_venv python -m pip install mypy - python -m mypy "$CI_PROJECT_NAME" test + ./run-mypy.sh tags: - python3 except: diff --git a/run-mypy.sh b/run-mypy.sh new file mode 100755 index 0000000000000000000000000000000000000000..75f2cff8df6301dac507ac81dda9ab8fa60d81c8 --- /dev/null +++ b/run-mypy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python -m mypy arraycontext/ examples/ test/ diff --git a/run-pylint.sh b/run-pylint.sh new file mode 100755 index 0000000000000000000000000000000000000000..6c7386669da645c3349bfb09355b80d0573f7273 --- /dev/null +++ b/run-pylint.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -o errexit -o nounset + +ci_support="https://gitlab.tiker.net/inducer/ci-support/raw/main" + +if [[ ! -f .pylintrc.yml ]]; then + curl -o .pylintrc.yml "${ci_support}/.pylintrc-default.yml" +fi + + +if [[ ! -f .run-pylint.py ]]; then + curl -L -o .run-pylint.py "${ci_support}/run-pylint.py" +fi + + +PYLINT_RUNNER_ARGS="--jobs=4 --yaml-rcfile=.pylintrc.yml" + +if [[ -f .pylintrc-local.yml ]]; then + PYLINT_RUNNER_ARGS+=" --yaml-rcfile=.pylintrc-local.yml" +fi + +python .run-pylint.py $PYLINT_RUNNER_ARGS $(basename $PWD) test/test_*.py examples "$@"