mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Enable pyright's reportUnnecessaryTypeIgnoreComment setting for the whole test_cases directory (#8683)
This commit is contained in:
@@ -40,11 +40,8 @@ mypy's
|
||||
setting and pyright's
|
||||
[`reportUnnecessaryTypeIgnoreComment`](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#type-check-diagnostics-settings)
|
||||
setting) to test instances where a type checker *should* emit some kind of
|
||||
error, if the stubs are correct. Note that mypy's `--warn-unused-ignores`
|
||||
setting is enabled for the entire subdirectory; however, the pyright setting
|
||||
must be enabled on a per-file basis with
|
||||
`# pyright: reportUnnecessaryTypeIgnoreComment=true` at the the top of the
|
||||
file.
|
||||
error, if the stubs are correct. Both settings are enabled by default for the entire
|
||||
subdirectory.
|
||||
|
||||
For more information on using `assert_type` and
|
||||
`--warn-unused-ignores`/`reportUnnecessaryTypeIgnoreComment` to test type
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# pyright: reportUnnecessaryTypeIgnoreComment=true
|
||||
|
||||
from typing import Dict, Generic, Iterable, Tuple, TypeVar
|
||||
from typing_extensions import assert_type
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# pyright: reportUnnecessaryTypeIgnoreComment=true
|
||||
|
||||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
from typing import Any
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# pyright: reportUnnecessaryTypeIgnoreComment=true
|
||||
|
||||
from typing import Any, List, Union
|
||||
from typing_extensions import Literal, assert_type
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# pyright: reportUnnecessaryTypeIgnoreComment=true
|
||||
|
||||
import codecs
|
||||
from typing_extensions import assert_type
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# pyright: reportUnnecessaryTypeIgnoreComment=true
|
||||
|
||||
import unittest
|
||||
from datetime import datetime, timedelta
|
||||
from decimal import Decimal
|
||||
|
||||
Reference in New Issue
Block a user