diff --git a/.github/mypy_check.sh b/.github/mypy_check.sh deleted file mode 100755 index 0058b1d2ee..0000000000 --- a/.github/mypy_check.sh +++ /dev/null @@ -1,5 +0,0 @@ -if [ "$(basename "$(pwd)")" = ".github" ]; then - cd .. -fi - -xargs mypy --strict --follow-imports=silent --no-warn-unused-ignore --install-types --non-interactive typings < .github/mypy_files.txt diff --git a/.github/mypy_files.txt b/.github/mypy_files.txt deleted file mode 100644 index 0f0bef1ee4..0000000000 --- a/.github/mypy_files.txt +++ /dev/null @@ -1,2 +0,0 @@ -worlds/AutoSNIClient.py -Patch.py diff --git a/.github/pyright-config.json b/.github/pyright-config.json new file mode 100644 index 0000000000..2e9635706c --- /dev/null +++ b/.github/pyright-config.json @@ -0,0 +1,26 @@ +{ + "include": [ + "../worlds/AutoSNIClient.py", + "../Patch.py" + ], + + "exclude": [ + "**/__pycache__" + ], + + "stubPath": "../typings", + + "typeCheckingMode": "strict", + "reportImplicitOverride": "error", + "reportMissingImports": true, + "reportMissingTypeStubs": true, + + "pythonVersion": "3.8", + "pythonPlatform": "Linux", + + "executionEnvironments": [ + { + "root": ".." + } + ] +} diff --git a/.github/type_check.sh b/.github/type_check.sh new file mode 100755 index 0000000000..7a2def2d7e --- /dev/null +++ b/.github/type_check.sh @@ -0,0 +1,5 @@ +if [ "$(basename "$(pwd)")" = ".github" ]; then + cd .. +fi + +xargs pyright -p .github/pyright-config.json diff --git a/.github/workflows/strict-type-check.yml b/.github/workflows/strict-type-check.yml index e448d27725..f893766c56 100644 --- a/.github/workflows/strict-type-check.yml +++ b/.github/workflows/strict-type-check.yml @@ -20,8 +20,8 @@ jobs: - name: "Install dependencies" run: | - python -m pip install --upgrade pip mypy + python -m pip install --upgrade pip pyright python ModuleUpdate.py --append "WebHostLib/requirements.txt" --force --yes - - name: "mypy: strict check on specific files" - run: .github/mypy_check.sh + - name: "pyright: strict check on specific files" + run: .github/type_check.sh