Skip to content

Commit

Permalink
reveal_locals: indent following lines with 4 spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jun 5, 2019
1 parent e8d9c9a commit 85f5df0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/source/common_issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ to see the types of all local variables at once. Example:
b = 'one'
reveal_locals()
# Revealed local types are:
# a: builtins.int
# b: builtins.str
# a: builtins.int
# b: builtins.str
.. note::

``reveal_type`` and ``reveal_locals`` are only understood by mypy and
Expand Down
2 changes: 1 addition & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ def reveal_locals(self, type_map: Dict[str, Optional[Type]], context: Context) -
# use an ordered dictionary sorted by variable name
sorted_locals = OrderedDict(sorted(type_map.items(), key=lambda t: t[0]))
self.note("Revealed local types are:", context)
for line in ['{}: {}'.format(k, v) for k, v in sorted_locals.items()]:
for line in [' {}: {}'.format(k, v) for k, v in sorted_locals.items()]:
self.note(line, context)

def unsupported_type_type(self, item: Type, context: Context) -> None:
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-classes.test
Original file line number Diff line number Diff line change
Expand Up @@ -5013,8 +5013,8 @@ class C1(object):

[out]
main:5: note: Revealed local types are:
main:5: note: t: builtins.str
main:5: note: y: builtins.float
main:5: note: t: builtins.str
main:5: note: y: builtins.float

[case testAbstractClasses]
import a
Expand Down
6 changes: 3 additions & 3 deletions test-data/unit/check-expressions.test
Original file line number Diff line number Diff line change
Expand Up @@ -1831,9 +1831,9 @@ z = x + y
reveal_locals()
[out]
main:4: note: Revealed local types are:
main:4: note: x: builtins.int
main:4: note: y: builtins.int
main:4: note: z: builtins.int
main:4: note: x: builtins.int
main:4: note: y: builtins.int
main:4: note: z: builtins.int

[case testUndefinedRevealType]
reveal_type(x)
Expand Down
12 changes: 6 additions & 6 deletions test-data/unit/check-functions.test
Original file line number Diff line number Diff line change
Expand Up @@ -2451,14 +2451,14 @@ def f(a: int, b: int) -> int:
reveal_locals()
[out]
main:6: note: Revealed local types are:
main:6: note: a: builtins.int
main:6: note: b: builtins.int
main:6: note: a: builtins.int
main:6: note: b: builtins.int
main:9: note: Revealed local types are:
main:9: note: a: builtins.int
main:9: note: b: builtins.int
main:9: note: c: builtins.int
main:9: note: a: builtins.int
main:9: note: b: builtins.int
main:9: note: c: builtins.int
main:12: note: Revealed local types are:
main:12: note: a: builtins.float
main:12: note: a: builtins.float

[case testNoComplainOverloadNone]
# flags: --no-strict-optional
Expand Down

0 comments on commit 85f5df0

Please sign in to comment.