Meta+CI: Add pyright type checking to lint_python.sh
This commit is contained in:
parent
935b185aaa
commit
5aa0d13a99
3 changed files with 18 additions and 1 deletions
2
.github/actions/setup/action.yml
vendored
2
.github/actions/setup/action.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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[@]}"
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue