mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add an initial pyright configuration (#12924)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
0a162fa8da
commit
26c30b5290
20
.github/workflows/lint.yml
vendored
20
.github/workflows/lint.yml
vendored
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user