You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am fixing a large number of mypy errors in a code base that is automatically Black-reformatted.
I keep running in the issue where I must add a # type: ignore to the end of some line, and that takes it over the max length. Black reformats the line, keeping the # type: ignore at the end of the statement, but the mypy error is specific to some subexpression that's not on the last line after reformatting.
(A similar thing happens to list literals and comprehensions.)
Can you please (even if only as an option) make it so that a # type: ignore comment is not considered to exceed the line length?
Note that for a regular type annotation (e.g. # type: List[int]) this is not a problem, so I'm fine with those being moved around. But # type: ignore is tied specifically to a line number.
I wouldn't bring this up if I didn't encounter this over and over.
I am fixing a large number of mypy errors in a code base that is automatically Black-reformatted.
I keep running in the issue where I must add a
# type: ignore
to the end of some line, and that takes it over the max length. Black reformats the line, keeping the# type: ignore
at the end of the statement, but the mypy error is specific to some subexpression that's not on the last line after reformatting.For example,
is reformatted as
but actually the error happens on the first line, so I must manually change this to
(A similar thing happens to list literals and comprehensions.)
Can you please (even if only as an option) make it so that a
# type: ignore
comment is not considered to exceed the line length?Note that for a regular type annotation (e.g.
# type: List[int]
) this is not a problem, so I'm fine with those being moved around. But# type: ignore
is tied specifically to a line number.I wouldn't bring this up if I didn't encounter this over and over.
CC: @msullivan
The text was updated successfully, but these errors were encountered: