-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: enforce-repeated-arg-type-style rule finds false positives in case of invalid types #1046
fix: enforce-repeated-arg-type-style rule finds false positives in case of invalid types #1046
Conversation
…se of invalid types
@denisvmedia Thanks! I tested code from this PR and it fixes most of the cases. However, it still sees a problem for such cases (for
But when I change the second argument from
There is a similar problem with return types. |
Yeah, that was my oversight. I will fix it. Thanks! |
@zak-pawel does it work for you now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now it works very well, thanks!
Hi @denisvmedia thanks for the PR, it LGTM. |
@chavacava it's actually non-trivial to test it. We'll have to provide the means to pass fake imports in our test engine. Otherwise, any package we import won't be found and the tests will start failing. I played around with a custom (fake) importer, but I didn't have enough time to simulate the invalid package situation. I can try checking it later. Do you think we can merge this PR now without having the tests at the moment? |
IMO relying on actual type analysis is over-killing for such a simple rule. |
That's what my TODO comment actually says (maybe I wasn't clear enough in it ;)). But what I wanted is to have a quick fix to make sure that this rule at least doesn't have false positives (it seems to me to be better than having false negatives), and then invest some more time to have a full fix. But if you think it makes no sense to merge it as is, I can revise the PR. I'm just not sure when I will have time to play with it. |
closes #1032