Skip to content

Commit 4276308

Browse files
authored
(🎁) update black to 23.3.0 (#15059)
Co-authored-by: KotlinIsland <[email protected]>
1 parent 1449366 commit 4276308

36 files changed

+55
-67
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 22.12.0 # must match test-requirements.txt
3+
rev: 23.3.0 # must match test-requirements.txt
44
hooks:
55
- id: black
66
- repo: https://github.com/pycqa/isort

misc/analyze_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def load_json(data_path: str, meta_path: str) -> CacheData:
6262

6363

6464
def get_files(root: str) -> Iterable[CacheData]:
65-
for (dirpath, dirnames, filenames) in os.walk(root):
65+
for dirpath, dirnames, filenames in os.walk(root):
6666
for filename in filenames:
6767
if filename.endswith(".data.json"):
6868
meta_filename = filename.replace(".data.json", ".meta.json")

misc/fix_annotate.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def foo(self, bar, baz=12):
3838

3939

4040
class FixAnnotate(BaseFix):
41-
4241
# This fixer is compatible with the bottom matcher.
4342
BM_compatible = True
4443

mypy/api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151

5252

5353
def _run(main_wrapper: Callable[[TextIO, TextIO], None]) -> tuple[str, str, int]:
54-
5554
stdout = StringIO()
5655
stderr = StringIO()
5756

mypy/checker.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,6 @@ def erase_override(t: Type) -> Type:
20682068
if not is_subtype(
20692069
original.arg_types[i], erase_override(override.arg_types[i])
20702070
):
2071-
20722071
arg_type_in_super = original.arg_types[i]
20732072

20742073
if isinstance(node, FuncDef):
@@ -2954,7 +2953,6 @@ def check_compatibility_all_supers(
29542953
and lvalue.kind in (MDEF, None)
29552954
and len(lvalue_node.info.bases) > 0 # None for Vars defined via self
29562955
):
2957-
29582956
for base in lvalue_node.info.mro[1:]:
29592957
tnode = base.names.get(lvalue_node.name)
29602958
if tnode is not None:

mypy/checkexpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
# Type of callback user for checking individual function arguments. See
171171
# check_args() below for details.
172172
ArgChecker: _TypeAlias = Callable[
173-
[Type, Type, ArgKind, Type, int, int, CallableType, Optional[Type], Context, Context], None,
173+
[Type, Type, ArgKind, Type, int, int, CallableType, Optional[Type], Context, Context], None
174174
]
175175

176176
# Maximum nesting level for math union in overloads, setting this to large values
@@ -845,7 +845,7 @@ def check_typeddict_call_with_kwargs(
845845
# this may give a better error message.
846846
ret_type = callee
847847

848-
for (item_name, item_expected_type) in ret_type.items.items():
848+
for item_name, item_expected_type in ret_type.items.items():
849849
if item_name in kwargs:
850850
item_value = kwargs[item_name]
851851
self.chk.check_simple_assignment(

mypy/checkstrformat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class ConversionSpecifier:
139139
def __init__(
140140
self, match: Match[str], start_pos: int = -1, non_standard_format_spec: bool = False
141141
) -> None:
142-
143142
self.whole_seq = match.group()
144143
self.start_pos = start_pos
145144

mypy/config_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from mypy.options import PER_MODULE_OPTIONS, Options
3535

3636
_CONFIG_VALUE_TYPES: _TypeAlias = Union[
37-
str, bool, int, float, Dict[str, str], List[str], Tuple[int, int],
37+
str, bool, int, float, Dict[str, str], List[str], Tuple[int, int]
3838
]
3939
_INI_PARSER_CALLABLE: _TypeAlias = Callable[[Any], _CONFIG_VALUE_TYPES]
4040

mypy/constraints.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,6 @@ def infer_against_overloaded(
10061006
return infer_constraints(template, item, self.direction)
10071007

10081008
def visit_tuple_type(self, template: TupleType) -> list[Constraint]:
1009-
10101009
actual = self.actual
10111010
unpack_index = find_unpack_in_list(template.items)
10121011
is_varlength_tuple = (
@@ -1065,7 +1064,7 @@ def visit_typeddict_type(self, template: TypedDictType) -> list[Constraint]:
10651064
res: list[Constraint] = []
10661065
# NOTE: Non-matching keys are ignored. Compatibility is checked
10671066
# elsewhere so this shouldn't be unsafe.
1068-
for (item_name, template_item_type, actual_item_type) in template.zip(actual):
1067+
for item_name, template_item_type, actual_item_type in template.zip(actual):
10691068
res.extend(infer_constraints(template_item_type, actual_item_type, self.direction))
10701069
return res
10711070
elif isinstance(actual, AnyType):

mypy/dmypy_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def ignore_suppressed_imports(module: str) -> bool:
163163

164164

165165
class Server:
166-
167166
# NOTE: the instance is constructed in the parent process but
168167
# serve() is called in the grandchild (by daemonize()).
169168

@@ -828,7 +827,6 @@ def update_sources(self, sources: list[BuildSource]) -> None:
828827
def update_changed(
829828
self, sources: list[BuildSource], remove: list[str], update: list[str]
830829
) -> ChangesAndRemovals:
831-
832830
changed_paths = self.fswatcher.update_changed(remove, update)
833831
return self._find_changed(sources, changed_paths)
834832

0 commit comments

Comments
 (0)