Skip to content

Commit 2ab8203

Browse files
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 471e39d. * 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>
1 parent 3846b65 commit 2ab8203

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

.github/workflows/pyright.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-FileCopyrightText: (c) TagStudio Contributors
2+
# SPDX-License-Identifier: GPL-3.0-only
3+
---
4+
name: Pyright
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
pyright:
10+
name: Run Pyright
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
cache: pip
21+
22+
- name: Install Python dependencies
23+
run: |
24+
python -m pip install --upgrade uv
25+
uv pip install --system .[pyright,pytest]
26+
27+
- name: Execute Pyright
28+
uses: jordemort/action-pyright@v1
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ dependencies = [
4545
dev = ["tagstudio[mkdocs,mypy,pre-commit,pyinstaller,pytest,ruff]"]
4646
mkdocs = ["mkdocs-material[imaging]>=9.6.14", "mkdocs-redirects~=1.2"]
4747
mypy = ["mypy==1.15.0", "mypy-extensions==1.*", "types-ujson~=5.10"]
48+
pyright = ["pyright~=1.1.409"]
4849
pre-commit = ["pre-commit~=4.2"]
4950
pyinstaller = ["Pyinstaller~=6.13"]
5051
pytest = [
@@ -99,18 +100,19 @@ ignore = [
99100
"src/tagstudio/qt/previews/vendored/pydub/",
100101
]
101102
include = ["src/tagstudio", "tests"]
103+
# reference for the settings here: https://github.com/microsoft/pyright/blob/main/docs/configuration.md
102104
reportAny = false
103105
reportIgnoreCommentWithoutRule = false
104106
reportImplicitStringConcatenation = false
105107
reportImportCycles = false
106108
reportMissingTypeArgument = false
107109
reportMissingTypeStubs = false
108110
# reportOptionalMemberAccess = false
109-
reportUnannotatedClassAttribute = false
110111
reportUnknownArgumentType = false
111112
reportUnknownLambdaType = false
112113
reportUnknownMemberType = false
113114
reportUnusedCallResult = false
115+
reportUnannotatedClassAttribute = false
114116
reportUninitializedInstanceVariable = false
115117

116118
[tool.ruff]

0 commit comments

Comments
 (0)