Meta+CI: Add pyright type checking to lint_python.sh

This commit is contained in:
Zaggy1024 2026-04-29 22:08:13 -05:00 committed by Gregory Bertilson
parent 935b185aaa
commit 5aa0d13a99
3 changed files with 18 additions and 1 deletions

View file

@ -66,7 +66,7 @@ runs:
if ${{ inputs.type == 'build' }} ; then
pip3 install pyyaml requests six
else
pip3 install ruff
pip3 install pyright ruff
fi
- name: Ensure clang-cl is available

View file

@ -31,11 +31,18 @@ else
fi
if (( ${#files[@]} )); then
if ! command -v pyright >/dev/null 2>&1 ; then
echo "Please install pyright: pip3 install pyright"
exit 1
fi
if ! command -v ruff >/dev/null 2>&1 ; then
echo "Please install ruff: pip3 install ruff"
exit 1
fi
pyright "${files[@]}"
if [[ ${overwrite} -eq 0 ]] ; then
ruff check "${files[@]}"
ruff format --check "${files[@]}"

View file

@ -12,3 +12,13 @@ extend-select = [
[tool.ruff.lint.isort]
force-single-line = true
lines-between-types = 1
[tool.pyright]
pythonVersion = "3.9"
extraPaths = ["Meta"]
exclude = [
"**/node_modules",
"**/__pycache__",
"**/.*",
"**/lit.cfg.py",
]