Current multiline error/notice reporting is hacky, e.g.
|
self.note("Superclass:", context, offset=ALIGN_OFFSET + OFFSET, code=code) |
|
self.pretty_callable_or_overload( |
|
original, |
|
context, |
|
offset=ALIGN_OFFSET + 2 * OFFSET, |
|
add_class_or_static_decorator=INCLUDE_DECORATOR, |
|
allow_dups=ALLOW_DUPS, |
|
code=code, |
|
) |
Notice how
- we call
notice multiple times even as it relates to the same core issue
- we pass
allow_dups=True to suppress deduplication of, say, the same type
- we mistakenly(?) dedup the "Superclass:" and "Subclass:" notices
- by always doing
allow_dups=False, we can effectively dedup when it would make sense
I think it'll be better if the extra lines could be part of the error, also reducing code duplication (we end up passing a lot of the same parameters multiple times). Is there a reason why we didn't? Is it a pattern elsewhere in the code?
Current multiline error/notice reporting is hacky, e.g.
mypy/mypy/messages.py
Lines 1161 to 1169 in c1fb57d
Notice how
noticemultiple times even as it relates to the same core issueallow_dups=Trueto suppress deduplication of, say, the same typeallow_dups=False, we can effectively dedup when it would make senseI think it'll be better if the extra lines could be part of the error, also reducing code duplication (we end up passing a lot of the same parameters multiple times). Is there a reason why we didn't? Is it a pattern elsewhere in the code?