From 2ab8203967f802d873a80878ba8e7633d6b8e37e Mon Sep 17 00:00:00 2001 From: Jann Stute <46534683+Computerdores@users.noreply.github.com> Date: Thu, 14 May 2026 10:45:52 +0200 Subject: [PATCH] ci: add pyright workflow (#1232) * ci: initial version of pyright workflow * ci: remove invalid pyright settings * debug: return ALL results from pyright * ci: remove unnecessary reviewdog install * Revert "debug: return ALL results from pyright" This reverts commit 471e39d29f09c59ef1f773bc087d3fe4f91bc4b3. * ci: choose reporter based on event type * ci: choose correct reporter for non-pr event * ci: small cleanup * ci: also install pytest deps * doc: add license info for new workflow * chore: bump pyright patch version Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> * fix: add back settings for basedpyright --------- Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> --- .github/workflows/pyright.yaml | 31 +++++++++++++++++++++++++++++++ pyproject.toml | 4 +++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pyright.yaml diff --git a/.github/workflows/pyright.yaml b/.github/workflows/pyright.yaml new file mode 100644 index 00000000..59de9bf3 --- /dev/null +++ b/.github/workflows/pyright.yaml @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: (c) TagStudio Contributors +# SPDX-License-Identifier: GPL-3.0-only +--- +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 5d7c4ddf..b311b632 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,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.409"] pre-commit = ["pre-commit~=4.2"] pyinstaller = ["Pyinstaller~=6.13"] pytest = [ @@ -99,6 +100,7 @@ ignore = [ "src/tagstudio/qt/previews/vendored/pydub/", ] include = ["src/tagstudio", "tests"] +# reference for the settings here: https://github.com/microsoft/pyright/blob/main/docs/configuration.md reportAny = false reportIgnoreCommentWithoutRule = false reportImplicitStringConcatenation = false @@ -106,11 +108,11 @@ reportImportCycles = false reportMissingTypeArgument = false reportMissingTypeStubs = false # reportOptionalMemberAccess = false -reportUnannotatedClassAttribute = false reportUnknownArgumentType = false reportUnknownLambdaType = false reportUnknownMemberType = false reportUnusedCallResult = false +reportUnannotatedClassAttribute = false reportUninitializedInstanceVariable = false [tool.ruff]