-
Notifications
You must be signed in to change notification settings - Fork 192
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
Apply Type Comments: Allow for skipping quotes when applying type comments #644
Conversation
Codecov Report
@@ Coverage Diff @@
## main #644 +/- ##
==========================================
- Coverage 94.79% 94.78% -0.01%
==========================================
Files 245 245
Lines 25289 25304 +15
==========================================
+ Hits 23973 23985 +12
- Misses 1316 1319 +3
Continue to review full report at Codecov.
|
@@ -388,7 +412,7 @@ class ConvertTypeComments(VisitorBasedCodemodCommand): | |||
- For parameters, we prefer inline type comments to | |||
function-level type comments if we find both. | |||
|
|||
We always apply the type comments as quoted annotations, unless | |||
We always apply the type comments as quote_annotations annotations, unless |
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.
whoops
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.
I think this one is intended - in the docstring I do want to talk about "quoted annotations" when discussing the impact of the flag on output, quote_annotations
is just the name of the python variable.
Summary
The motivation for this is pytorch, where type comments mostly are maintained and it is
better to avoid quotes in methods that have jit compiler decorators.
Test Plan
I added a new test case verifying that the flag is properly propagated for all node types
that we would transform. Tests pass.