Skip to content

Commit

Permalink
Use --no-implicit-reexport and --disallow-untyped-decorators (#13329)
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored Aug 5, 2022
1 parent 608de81 commit 002ec8c
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 18 deletions.
4 changes: 2 additions & 2 deletions mypy/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
from mypy.fscache import FileSystemCache
from mypy.metastore import FilesystemMetadataStore, MetadataStore, SqliteMetadataStore
from mypy.modulefinder import (
BuildSource,
BuildSourceSet,
BuildSource as BuildSource,
BuildSourceSet as BuildSourceSet,
FindModuleCache,
ModuleNotFoundReason,
ModuleSearchResult,
Expand Down
2 changes: 1 addition & 1 deletion mypy/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from mypy.util import get_class_descriptors, replace_object_state

if TYPE_CHECKING:
from mypy.errors import ErrorCode
from mypy.errorcodes import ErrorCode


class BuildType:
Expand Down
4 changes: 3 additions & 1 deletion mypy/plugins/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
)
from mypy.plugin import CheckerPluginInterface, ClassDefContext, SemanticAnalyzerPluginInterface
from mypy.semanal import ALLOW_INCOMPATIBLE_OVERRIDE, set_callable_name
from mypy.typeops import try_getting_str_literals # noqa: F401 # Part of public API
from mypy.typeops import ( # noqa: F401 # Part of public API
try_getting_str_literals as try_getting_str_literals,
)
from mypy.types import (
CallableType,
Overloaded,
Expand Down
3 changes: 1 addition & 2 deletions mypy/plugins/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Callable, List, Optional

from mypy import message_registry
from mypy.checkexpr import is_literal_type_like
from mypy.nodes import DictExpr, IntExpr, StrExpr, UnaryExpr
from mypy.plugin import (
AttributeContext,
Expand All @@ -14,7 +13,7 @@
)
from mypy.plugins.common import try_getting_str_literals
from mypy.subtypes import is_subtype
from mypy.typeops import make_simplified_union
from mypy.typeops import is_literal_type_like, make_simplified_union
from mypy.types import (
TPDICT_FB_NAMES,
AnyType,
Expand Down
2 changes: 1 addition & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
PRIORITY_FALLBACKS,
SemanticAnalyzerInterface,
calculate_tuple_fallback,
set_callable_name,
set_callable_name as set_callable_name,
)
from mypy.semanal_typeddict import TypedDictAnalyzer
from mypy.tvar_scope import TypeVarLikeScope
Expand Down
2 changes: 1 addition & 1 deletion mypy/server/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class 'mod.Cls'. This can also refer to an attribute inherited from a

from typing_extensions import DefaultDict

from mypy.checkmember import bind_self
from mypy.nodes import (
GDEF,
LDEF,
Expand Down Expand Up @@ -142,6 +141,7 @@ class 'mod.Cls'. This can also refer to an attribute inherited from a
from mypy.scope import Scope
from mypy.server.trigger import make_trigger, make_wildcard_trigger
from mypy.traverser import TraverserVisitor
from mypy.typeops import bind_self
from mypy.types import (
AnyType,
CallableType,
Expand Down
3 changes: 2 additions & 1 deletion mypy/suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@

from typing_extensions import TypedDict

from mypy.argmap import map_actuals_to_formals
from mypy.build import Graph, State
from mypy.checkexpr import has_any_type, map_actuals_to_formals
from mypy.checkexpr import has_any_type
from mypy.find_sources import InvalidSourceList, SourceFinder
from mypy.join import join_type_list
from mypy.meet import meet_type_list
Expand Down
4 changes: 3 additions & 1 deletion mypy/test/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

# Exporting Suite as alias to TestCase for backwards compatibility
# TODO: avoid aliasing - import and subclass TestCase directly
from unittest import TestCase as Suite # noqa: F401 (re-exporting)
from unittest import TestCase

Suite = TestCase # re-exporting

import pytest

Expand Down
22 changes: 15 additions & 7 deletions mypy_self_check.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
[mypy]

warn_unused_configs = True
disallow_any_generics = True
disallow_subclassing_any = True
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_subclassing_any = True
warn_no_return = True
strict_optional = True
strict_equality = True
disallow_untyped_decorators = True
no_implicit_optional = True
disallow_any_generics = True
disallow_any_unimported = True
warn_redundant_casts = True
warn_unused_ignores = True
warn_unused_configs = True
no_implicit_reexport = True
strict_equality = True
strict_concatenate = True

; This is the only setting in --strict that we don't have enabled
warn_return_any = False

warn_no_return = True
strict_optional = True
disallow_any_unimported = True
show_traceback = True
show_error_codes = True
pretty = True
Expand Down
2 changes: 1 addition & 1 deletion mypyc/irbuild/ll_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from typing_extensions import Final

from mypy.checkexpr import map_actuals_to_formals
from mypy.argmap import map_actuals_to_formals
from mypy.nodes import ARG_POS, ARG_STAR, ARG_STAR2, ArgKind
from mypy.operators import op_methods
from mypy.types import AnyType, TypeOfAny
Expand Down

0 comments on commit 002ec8c

Please sign in to comment.