ruff
403bd20a - [ty] Avoid extending own-line suppressions in `--add-ignore` (#26808)

Commit
31 days ago
[ty] Avoid extending own-line suppressions in `--add-ignore` (#26808) ## Summary This builds on #26785 by teaching `ty check --add-ignore` how to handle applicable own-line suppressions without broadening a preceding directive to cover additional diagnostics. In effect, we never use own-line comments for `--add-ignore`, whereas previously we may have applied them to more lines than intended. Put differently, we now only extend an existing suppression when its comment is on the same physical line as the diagnostic's suppression range. If an applicable own-line suppression appears on a preceding line, we leave it unchanged and add an end-of-line suppression at the diagnostic instead: ```python # ty: ignore[invalid-assignment] values: tuple[int] = f( missing, # ty:ignore[unresolved-reference] "bad", # ty:ignore[invalid-argument-type] ) ```
Author
Parents
Loading