Improve multiline reporting
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Current multiline error/notice reporting is hacky, e.g.
https://github.com/python/mypy/blob/c1fb57d38116adf6c1c1ea5c4b998cae597ec156/mypy/messages.py#L1161-L1169
Notice how
- we call
noticemultiple times even as it relates to the same core issue - we pass
allow_dups=Trueto 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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mypy/messages.py at the linked lines 1161-1169 and trace the related notice and deduplication behavior. Look for other multiline reporting patterns and determine how extra lines could belong to one error without incorrect deduplication. Done should reduce repeated parameter passing while preserving the intended distinction between related notices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100