forked from python/typeshed
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Typecheck typeshed's code with pyright (python#9793)
Co-authored-by: Alex Waygood <[email protected]> Co-authored-by: Jelle Zijlstra <[email protected]>
- Loading branch information
1 parent
b0dc6a3
commit 75f47d0
Showing
12 changed files
with
125 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,31 @@ jobs: | |
cache-dependency-path: requirements-tests.txt | ||
- run: pip install -r requirements-tests.txt | ||
- run: python ./tests/typecheck_typeshed.py --platform=${{ matrix.platform }} | ||
pyright: | ||
name: Run pyright against the scripts and tests directories | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-platform: ["Linux", "Windows"] | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: pip | ||
cache-dependency-path: requirements-tests.txt | ||
- run: pip install -r requirements-tests.txt | ||
- name: Get pyright version | ||
uses: SebRollen/[email protected] | ||
id: pyright_version | ||
with: | ||
file: "pyproject.toml" | ||
field: "tool.typeshed.pyright_version" | ||
- name: Run pyright on typeshed | ||
uses: jakebailey/pyright-action@v1 | ||
with: | ||
version: ${{ steps.pyright_version.outputs.value }} | ||
python-platform: ${{ matrix.python-platform }} | ||
python-version: "3.9" | ||
project: ./pyrightconfig.scripts_and_tests.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", | ||
"typeshedPath": ".", | ||
"include": [ | ||
"scripts", | ||
"tests", | ||
], | ||
"typeCheckingMode": "strict", | ||
// Runtime libraries used by typeshed are not all py.typed | ||
"useLibraryCodeForTypes": true, | ||
// More of a lint. Unwanted for typeshed's own code. | ||
"reportImplicitStringConcatenation": "none", | ||
// Extra strict settings | ||
"reportMissingModuleSource": "error", | ||
"reportShadowedImports": "error", | ||
"reportCallInDefaultInitializer": "error", | ||
"reportPropertyTypeMismatch": "error", | ||
"reportUninitializedInstanceVariable": "error", | ||
"reportUnnecessaryTypeIgnoreComment": "error", | ||
// Leave "type: ignore" comments to mypy | ||
"enableTypeIgnoreComments": false, | ||
// Too strict | ||
"reportMissingSuperCall": "none", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters