Skip to content

Commit 85f5df0

Browse files
committed
reveal_locals: indent following lines with 4 spaces
1 parent e8d9c9a commit 85f5df0

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

docs/source/common_issues.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ to see the types of all local variables at once. Example:
456456
b = 'one'
457457
reveal_locals()
458458
# Revealed local types are:
459-
# a: builtins.int
460-
# b: builtins.str
459+
# a: builtins.int
460+
# b: builtins.str
461461
.. note::
462462

463463
``reveal_type`` and ``reveal_locals`` are only understood by mypy and

mypy/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ def reveal_locals(self, type_map: Dict[str, Optional[Type]], context: Context) -
10741074
# use an ordered dictionary sorted by variable name
10751075
sorted_locals = OrderedDict(sorted(type_map.items(), key=lambda t: t[0]))
10761076
self.note("Revealed local types are:", context)
1077-
for line in ['{}: {}'.format(k, v) for k, v in sorted_locals.items()]:
1077+
for line in [' {}: {}'.format(k, v) for k, v in sorted_locals.items()]:
10781078
self.note(line, context)
10791079

10801080
def unsupported_type_type(self, item: Type, context: Context) -> None:

test-data/unit/check-classes.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5013,8 +5013,8 @@ class C1(object):
50135013

50145014
[out]
50155015
main:5: note: Revealed local types are:
5016-
main:5: note: t: builtins.str
5017-
main:5: note: y: builtins.float
5016+
main:5: note: t: builtins.str
5017+
main:5: note: y: builtins.float
50185018

50195019
[case testAbstractClasses]
50205020
import a

test-data/unit/check-expressions.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,9 +1831,9 @@ z = x + y
18311831
reveal_locals()
18321832
[out]
18331833
main:4: note: Revealed local types are:
1834-
main:4: note: x: builtins.int
1835-
main:4: note: y: builtins.int
1836-
main:4: note: z: builtins.int
1834+
main:4: note: x: builtins.int
1835+
main:4: note: y: builtins.int
1836+
main:4: note: z: builtins.int
18371837

18381838
[case testUndefinedRevealType]
18391839
reveal_type(x)

test-data/unit/check-functions.test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,14 +2451,14 @@ def f(a: int, b: int) -> int:
24512451
reveal_locals()
24522452
[out]
24532453
main:6: note: Revealed local types are:
2454-
main:6: note: a: builtins.int
2455-
main:6: note: b: builtins.int
2454+
main:6: note: a: builtins.int
2455+
main:6: note: b: builtins.int
24562456
main:9: note: Revealed local types are:
2457-
main:9: note: a: builtins.int
2458-
main:9: note: b: builtins.int
2459-
main:9: note: c: builtins.int
2457+
main:9: note: a: builtins.int
2458+
main:9: note: b: builtins.int
2459+
main:9: note: c: builtins.int
24602460
main:12: note: Revealed local types are:
2461-
main:12: note: a: builtins.float
2461+
main:12: note: a: builtins.float
24622462

24632463
[case testNoComplainOverloadNone]
24642464
# flags: --no-strict-optional

0 commit comments

Comments
 (0)