-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add type hints to all code #50
Conversation
And change the API of Linter.line_for_pos() and refactor its test.
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.
Thanks for doing this! Totally support it. Before I review.... did you intentionally skip adding return type hints on most functions? Is that planned for a follow-up PR? If so, I won't add comments about that here, other than the meta comment "most functions should have return type hints".
Adding -> None
for functions that don't return anything does improve mypy
's ability to catch bugs, by the way. I wrote this up a while ago to check my own understanding of that: https://gist.github.com/jameslamb/791021322f4bd448d478093e5c786f64
I only skipped return hints on functions that don't return anything (which is most of them). I'll go back and add |
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.
Thanks, I'm really glad we're doing this! Think it will help a lot. I went through all the changes in this PR, left a few more suggestions for your consideration.
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.
Looks great, thanks for considering all the review comments. Appreciate you going through and doing this!
No description provided.