Skip to content
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

Merged
merged 20 commits into from
Aug 26, 2024
Merged

Conversation

KyleFromNVIDIA
Copy link
Contributor

No description provided.

@KyleFromNVIDIA KyleFromNVIDIA requested a review from a team as a code owner August 23, 2024 21:02
Copy link
Member

@jameslamb jameslamb left a 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

@KyleFromNVIDIA
Copy link
Contributor Author

I only skipped return hints on functions that don't return anything (which is most of them). I'll go back and add -> None where applicable.

@jameslamb jameslamb self-requested a review August 26, 2024 17:07
Copy link
Member

@jameslamb jameslamb left a 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.

src/rapids_pre_commit_hooks/alpha_spec.py Outdated Show resolved Hide resolved
test/rapids_pre_commit_hooks/test_alpha_spec.py Outdated Show resolved Hide resolved
src/rapids_pre_commit_hooks/pyproject_license.py Outdated Show resolved Hide resolved
src/rapids_pre_commit_hooks/pyproject_license.py Outdated Show resolved Hide resolved
Copy link
Member

@jameslamb jameslamb left a 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!

@KyleFromNVIDIA KyleFromNVIDIA merged commit 2fb7ba6 into rapidsai:main Aug 26, 2024
2 checks passed
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.

2 participants