Skip to content

Commit 20a37ca

Browse files
committed
Add pyright
Underlying typechecker of pylance
1 parent 2477e95 commit 20a37ca

4 files changed

Lines changed: 14 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ RUN useradd -m dev && chown -R dev:dev /workspaces/dfetch
1515
USER dev
1616

1717
ENV PATH="/home/dev/.local/bin:${PATH}"
18+
ENV PYTHONPATH="/home/dev/.local/lib/python3.12"
19+
ENV PYTHONUSERBASE="/home/dev/.local"
1820

1921
COPY --chown=dev:dev . .
2022

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- run: pylint dfetch # Checks pep8 conformance
3737
- run: ruff check dfetch # Check using ruff
3838
- run: mypy --strict dfetch # Check types
39+
- run: pyright . # Check types
3940
- run: doc8 doc # Checks documentation
4041
- run: pydocstyle dfetch # Checks doc strings
4142
- run: bandit -r dfetch # Checks security issues

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,9 @@ repos:
107107
language: python
108108
args: [check]
109109
types: [file, python]
110+
- id: pyright
111+
name: pyright
112+
description: Lint using pyright
113+
entry: pyright
114+
language: python
115+
types: [file, python]

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ development = [
8787
"tomli; python_version < '3.11'", # Tomllib is default in 3.11, required for letting codespell read the pyproject.toml
8888
'pre-commit==4.1.0',
8989
'ruff==0.9.6',
90+
'pyright==1.1.394',
9091
]
9192
docs = [
9293
'sphinx==8.2.0',
@@ -160,3 +161,7 @@ skip = "*.cast,./venv,**/plantuml-c4/**,./example,.mypy_cache,./doc/_build/**,./
160161

161162
[tool.ruff.lint.per-file-ignores]
162163
"features/steps/*" = ["F811"]
164+
165+
[tool.pyright]
166+
exclude = ["doc/static/uml/generate_diagram.py"]
167+
strict = ["dfetch"]

0 commit comments

Comments
 (0)