Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 002ec8c

Browse files
authored
Use --no-implicit-reexport and --disallow-untyped-decorators (#13329)
1 parent 608de81 commit 002ec8c

10 files changed

Lines changed: 30 additions & 18 deletions

File tree

mypy/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
from mypy.fscache import FileSystemCache
7676
from mypy.metastore import FilesystemMetadataStore, MetadataStore, SqliteMetadataStore
7777
from mypy.modulefinder import (
78-
BuildSource,
79-
BuildSourceSet,
78+
BuildSource as BuildSource,
79+
BuildSourceSet as BuildSourceSet,
8080
FindModuleCache,
8181
ModuleNotFoundReason,
8282
ModuleSearchResult,

mypy/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from mypy.util import get_class_descriptors, replace_object_state
1111

1212
if TYPE_CHECKING:
13-
from mypy.errors import ErrorCode
13+
from mypy.errorcodes import ErrorCode
1414

1515

1616
class BuildType:

mypy/plugins/common.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
)
2020
from mypy.plugin import CheckerPluginInterface, ClassDefContext, SemanticAnalyzerPluginInterface
2121
from mypy.semanal import ALLOW_INCOMPATIBLE_OVERRIDE, set_callable_name
22-
from mypy.typeops import try_getting_str_literals # noqa: F401 # Part of public API
22+
from mypy.typeops import ( # noqa: F401 # Part of public API
23+
try_getting_str_literals as try_getting_str_literals,
24+
)
2325
from mypy.types import (
2426
CallableType,
2527
Overloaded,

mypy/plugins/default.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from typing import Callable, List, Optional
33

44
from mypy import message_registry
5-
from mypy.checkexpr import is_literal_type_like
65
from mypy.nodes import DictExpr, IntExpr, StrExpr, UnaryExpr
76
from mypy.plugin import (
87
AttributeContext,
@@ -14,7 +13,7 @@
1413
)
1514
from mypy.plugins.common import try_getting_str_literals
1615
from mypy.subtypes import is_subtype
17-
from mypy.typeops import make_simplified_union
16+
from mypy.typeops import is_literal_type_like, make_simplified_union
1817
from mypy.types import (
1918
TPDICT_FB_NAMES,
2019
AnyType,

mypy/semanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
PRIORITY_FALLBACKS,
223223
SemanticAnalyzerInterface,
224224
calculate_tuple_fallback,
225-
set_callable_name,
225+
set_callable_name as set_callable_name,
226226
)
227227
from mypy.semanal_typeddict import TypedDictAnalyzer
228228
from mypy.tvar_scope import TypeVarLikeScope

mypy/server/deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class 'mod.Cls'. This can also refer to an attribute inherited from a
8383

8484
from typing_extensions import DefaultDict
8585

86-
from mypy.checkmember import bind_self
8786
from mypy.nodes import (
8887
GDEF,
8988
LDEF,
@@ -142,6 +141,7 @@ class 'mod.Cls'. This can also refer to an attribute inherited from a
142141
from mypy.scope import Scope
143142
from mypy.server.trigger import make_trigger, make_wildcard_trigger
144143
from mypy.traverser import TraverserVisitor
144+
from mypy.typeops import bind_self
145145
from mypy.types import (
146146
AnyType,
147147
CallableType,

mypy/suggestions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@
4141

4242
from typing_extensions import TypedDict
4343

44+
from mypy.argmap import map_actuals_to_formals
4445
from mypy.build import Graph, State
45-
from mypy.checkexpr import has_any_type, map_actuals_to_formals
46+
from mypy.checkexpr import has_any_type
4647
from mypy.find_sources import InvalidSourceList, SourceFinder
4748
from mypy.join import join_type_list
4849
from mypy.meet import meet_type_list

mypy/test/helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
# Exporting Suite as alias to TestCase for backwards compatibility
1111
# TODO: avoid aliasing - import and subclass TestCase directly
12-
from unittest import TestCase as Suite # noqa: F401 (re-exporting)
12+
from unittest import TestCase
13+
14+
Suite = TestCase # re-exporting
1315

1416
import pytest
1517

mypy_self_check.ini

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
[mypy]
2+
3+
warn_unused_configs = True
4+
disallow_any_generics = True
5+
disallow_subclassing_any = True
26
disallow_untyped_calls = True
37
disallow_untyped_defs = True
48
disallow_incomplete_defs = True
59
check_untyped_defs = True
6-
disallow_subclassing_any = True
7-
warn_no_return = True
8-
strict_optional = True
9-
strict_equality = True
10+
disallow_untyped_decorators = True
1011
no_implicit_optional = True
11-
disallow_any_generics = True
12-
disallow_any_unimported = True
1312
warn_redundant_casts = True
1413
warn_unused_ignores = True
15-
warn_unused_configs = True
14+
no_implicit_reexport = True
15+
strict_equality = True
16+
strict_concatenate = True
17+
18+
; This is the only setting in --strict that we don't have enabled
19+
warn_return_any = False
20+
21+
warn_no_return = True
22+
strict_optional = True
23+
disallow_any_unimported = True
1624
show_traceback = True
1725
show_error_codes = True
1826
pretty = True

mypyc/irbuild/ll_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from typing_extensions import Final
1414

15-
from mypy.checkexpr import map_actuals_to_formals
15+
from mypy.argmap import map_actuals_to_formals
1616
from mypy.nodes import ARG_POS, ARG_STAR, ARG_STAR2, ArgKind
1717
from mypy.operators import op_methods
1818
from mypy.types import AnyType, TypeOfAny

0 commit comments

Comments
 (0)