Skip to content

[red-knot] Use relative paths in diagnostics rather than absolute paths #17233

Closed
@AlexWaygood

Description

@AlexWaygood

Diagnostics are currently reported with absolute paths, which makes them quite verbose even if you specify --output-format=concise. E.g. here's a diagnostic I got running red-knot from my /Users/alexw/dev/typeshed-stats directory:

error[lint:invalid-parameter-default] /Users/alexw/dev/typeshed-stats/scripts/runtests.py:17:5: Default value of type `EllipsisType` is not assignable to annotated parameter type `Literal[False]`

It would be nicer if we used the relative path instead, which is what Ruff does:

error[lint:invalid-parameter-default] scripts/runtests.py:17:5: Default value of type `EllipsisType` is not assignable to annotated parameter type `Literal[False]`

Metadata

Metadata

Assignees

Labels

diagnosticsRelated to reporting of diagnostics.tyMulti-file analysis & type inference

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions