-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
astral-sh/ruff
#22615Labels
configurationRelated to settings and configurationRelated to settings and configurationsuppressionRelated to supression of violations e.g. ty:ignoreRelated to supression of violations e.g. ty:ignore
Milestone
Description
Hello!
#1422 and astral-sh/ruff#22137, which added respect-type-ignore-comments as a global configuration option, have been very useful for me to avoid warnings in ty where it doesn't agree with mypy. I'd love if that could be applied on a file-by-file basis using overrides.
A common example is Pydantic's @computed_field decorator, which requires # type: ignore[prop-decorator] for mypy but doesn't need any ignore comment for ty.
Since a lot of those models are usually defined in a single file, or file matching a common pattern, an override would be super useful.
Example
from pydantic import BaseModel, computed_field
class MyModel(BaseModel):
@computed_field # type: ignore[prop-decorator]
@property
def my_prop(self) -> dict:
...Thanks for a great tool!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
configurationRelated to settings and configurationRelated to settings and configurationsuppressionRelated to supression of violations e.g. ty:ignoreRelated to supression of violations e.g. ty:ignore