Add an initial pyright configuration (#12924)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Adam Dangoor 2024-09-28 12:10:23 +01:00 committed by GitHub
parent 0a162fa8da
commit 26c30b5290
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 81 additions and 0 deletions

View File

@ -83,6 +83,26 @@ jobs:
- name: Type check with mypy
run: mypy
pyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3"
- name: Install uv
run: >
curl --no-progress-meter --location --fail
--proto '=https' --tlsv1.2
"https://astral.sh/uv/install.sh"
| sh
- name: Install dependencies
run: uv pip install ".[lint,test]"
- name: Type check with pyright
run: pyright
docs-lint:
runs-on: ubuntu-latest

View File

@ -92,6 +92,7 @@ lint = [
"types-requests==2.32.0.20240914", # align with requests
"types-urllib3==1.26.25.14",
"tomli>=2", # for mypy (Python<=3.10)
"pyright==1.1.382.post0",
"pytest>=6.0",
]
test = [
@ -303,3 +304,62 @@ exclude_lines = [
'if __name__ == .__main__.:',
]
ignore_errors = true
[tool.pyright]
typeCheckingMode = "strict"
include = [
"doc/conf.py",
"utils",
"sphinx",
"tests",
]
reportArgumentType = "none"
reportAssignmentType = "none"
reportAttributeAccessIssue = "none"
reportCallIssue = "none"
reportConstantRedefinition = "none"
reportDeprecated = "none"
reportGeneralTypeIssues = "none"
reportIncompatibleMethodOverride = "none"
reportIncompatibleVariableOverride = "none"
reportInconsistentOverload = "none"
reportIndexIssue = "none"
reportInvalidTypeArguments = "none"
reportInvalidTypeForm = "none"
reportInvalidTypeVarUse = "none"
reportMissingImports = "none"
reportMissingModuleSource = "none"
reportMissingParameterType = "none"
reportMissingTypeArgument = "none"
reportMissingTypeStubs = "none"
reportOperatorIssue = "none"
reportOptionalIterable = "none"
reportOptionalMemberAccess = "none"
reportOptionalOperand = "none"
reportOptionalSubscript = "none"
reportPossiblyUnboundVariable = "none"
reportPrivateUsage = "none"
reportRedeclaration = "none"
reportReturnType = "none"
reportSelfClsParameterName = "none"
reportTypeCommentUsage = "none"
reportTypedDictNotRequiredAccess = "none"
reportUndefinedVariable = "none"
reportUnknownArgumentType = "none"
reportUnknownLambdaType = "none"
reportUnknownMemberType = "none"
reportUnknownParameterType = "none"
reportUnknownVariableType = "none"
reportUnnecessaryComparison = "none"
reportUnnecessaryContains = "none"
reportUnnecessaryIsInstance = "none"
reportUnsupportedDunderAll = "none"
reportUntypedBaseClass = "none"
reportUntypedFunctionDecorator = "none"
reportUntypedNamedTuple = "none"
reportUnusedClass = "none"
reportUnusedFunction = "none"
reportUnusedImport = "none"
reportUnusedVariable = "none"
reportWildcardImportFromLibrary = "none"

View File

@ -39,6 +39,7 @@ commands =
ruff check . --output-format github
flake8 .
mypy
pyright
[testenv:docs]
description =