diff --git a/.github/workflows/pyright.yaml b/.github/workflows/pyright.yaml new file mode 100644 index 000000000..0c57315ef --- /dev/null +++ b/.github/workflows/pyright.yaml @@ -0,0 +1,29 @@ +--- +name: Pyright + +on: [push, pull_request] + +jobs: + pyright: + name: Run Pyright + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + + - name: Install Python dependencies + run: | + python -m pip install --upgrade uv + uv pip install --system .[pyright,pytest] + + - name: Execute Pyright + uses: jordemort/action-pyright@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }} diff --git a/pyproject.toml b/pyproject.toml index cb095d849..23a7c03bf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,7 @@ dependencies = [ dev = ["tagstudio[mkdocs,mypy,pre-commit,pyinstaller,pytest,ruff]"] mkdocs = ["mkdocs-material[imaging]>=9.6.14", "mkdocs-redirects~=1.2"] mypy = ["mypy==1.15.0", "mypy-extensions==1.*", "types-ujson~=5.10"] +pyright = ["pyright~=1.1.405"] pre-commit = ["pre-commit~=4.2"] pyinstaller = ["Pyinstaller~=6.13"] pytest = [ @@ -92,13 +93,11 @@ ignore = [ "src/tagstudio/qt/previews/vendored/pydub/", ] include = ["src/tagstudio", "tests"] -reportAny = false -reportIgnoreCommentWithoutRule = false +# reference for the settings here: https://github.com/microsoft/pyright/blob/main/docs/configuration.md reportImplicitStringConcatenation = false reportMissingTypeArgument = false reportMissingTypeStubs = false # reportOptionalMemberAccess = false -reportUnannotatedClassAttribute = false reportUnknownArgumentType = false reportUnknownLambdaType = false reportUnknownMemberType = false