Skip to content

note: is orphaned from actual error if there are other problems between it #10480

@asottile

Description

@asottile

Bug Report

the "note" is orphaned from the actual text it is referring to. this makes it harder to understand the context

To Reproduce

def f() -> int:
    error_here()
    return 1

f(wat=1)
  1. run mypy!

Expected Behavior

Maybe something like this?

$ mypy t.py
t.py:2: error: Name 'error_here' is not defined
t.py:5: error: Unexpected keyword argument "wat" for "f"
t.py:1: note: "f" defined here
Found 2 errors in 1 file (checked 1 source file)

Actual Behavior

$ mypy t.py
t.py:1: note: "f" defined here
t.py:2: error: Name 'error_here' is not defined
t.py:5: error: Unexpected keyword argument "wat" for "f"
Found 2 errors in 1 file (checked 1 source file)

Your Environment

  • Mypy version used: 0.812
  • Mypy command-line flags: n/a
  • Mypy configuration options from mypy.ini (and other config files): n/a
  • Python version used: 3.8.5
  • Operating system and version: ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions