Skip to content

Conversation

@stefanvanburen
Copy link
Member

ty is iterating rapidly, but already seems better than mypy.

Comment on lines +418 to +419
def validate(self, ctx: RuleContext, message: message.Message):
num_set_fields = sum(1 for field in self._fields if not _is_empty_field(message, field))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty wants the names of the arguments to match when over-riding from a superclass.

Comment on lines +620 to +626
def validate_item(self, ctx: RuleContext, value: typing.Any, *, for_key: bool = False):
self._validate_value(ctx, value, for_key=for_key)
self._validate_cel(
ctx, this_value=value, this_cel=_scalar_field_value_to_cel(value, self._field), for_key=for_key
)

def _validate_value(self, ctx: RuleContext, val: typing.Any, *, for_key: bool = False):
def _validate_value(self, ctx: RuleContext, value: typing.Any, *, for_key: bool = False):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to value here

@AdrienVannson
Copy link
Contributor

ty looks very promising , but do you think it is reliable enough yet?

I tried using it on protobuf-python (which now uses pyright), it produced a lot of false positive. I also see many issues on github, apparently it's not always completely deterministic, can crash in certain circonstances, etc

@stefanvanburen
Copy link
Member Author

@AdrienVannson Fair! I'm happy to wait for a release beyond 0.0.x. (As you can see, it has no trouble in this project, but it's pretty small.)

@stefanvanburen
Copy link
Member Author

(Going to just park this in draft for now.)

@stefanvanburen stefanvanburen removed the request for review from AdrienVannson January 16, 2026 18:46
@stefanvanburen stefanvanburen marked this pull request as draft January 16, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants