Skip to content

[DO-NOT-MERGE] Checking to see if pyright verifies third-party test cases against false negatives correctly #9623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ jobs:
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
project: ./pyrightconfig.stricter.json
- uses: jakebailey/pyright-action@v1
with:
version: ${{ steps.pyright_version.outputs.value }}
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
project: ./pyrightconfig.testcases.json
project: ./pyrightconfig.stricter.json
- uses: jakebailey/pyright-action@v1
with:
version: ${{ steps.pyright_version.outputs.value }}
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
project: ./pyrightconfig.testcases.json

stub-uploader:
name: Run the stub_uploader tests
Expand Down
4 changes: 4 additions & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"stdlib",
"stubs",
],
"exclude": [
// test cases use a custom config file
"stubs/**/@tests/test_cases"
],
"typeCheckingMode": "basic",
"strictListInference": true,
"strictDictionaryInference": true,
Expand Down
2 changes: 2 additions & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"stubs",
],
"exclude": [
// test cases use a custom pyrightconfig file
"stubs/**/@tests/test_cases",
"stdlib/distutils/command",
"stdlib/lib2to3/refactor.pyi",
"stdlib/_tkinter.pyi",
Expand Down
1 change: 1 addition & 0 deletions pyrightconfig.testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"typeshedPath": ".",
"include": [
"test_cases",
"stubs/**/@tests/test_cases"
],
"typeCheckingMode": "strict",
// Using unspecific "type ignore" comments in test_cases.
Expand Down
3 changes: 1 addition & 2 deletions stubs/invoke/@tests/test_cases/check_task.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# pyright: reportUnnecessaryTypeIgnoreComment=true
from __future__ import annotations

from invoke import Context, task
Expand All @@ -9,7 +8,7 @@


@task
def docker_build(context: Context) -> None:
def docker_build(context: Context) -> None: # type: ignore
pass


Expand Down