Skip to content

Commit

Permalink
Clean up lint errors in pyre infer apply annotations
Browse files Browse the repository at this point in the history
Summary: minor_lint_issues

Reviewed By: dkgi

Differential Revision: D34116053

fbshipit-source-id: 1df09d3ff6ad0e82d94664ed258072974f2d8732
  • Loading branch information
shannonzhu authored and facebook-github-bot committed Feb 9, 2022
1 parent dc58c30 commit 138c97c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions client/libcst_vendored_visitors/_apply_type_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@ class ApplyTypeAnnotationsVisitor(ContextAwareTransformer):
This is one of the transforms that is available automatically to you when
running a codemod. To use it in this manner, import
:class:`~libcst.codemod.visitors.ApplyTypeAnnotationsVisitor` and then call the static
:meth:`~libcst.codemod.visitors.ApplyTypeAnnotationsVisitor.store_stub_in_context` method,
giving it the current context (found as ``self.context`` for all subclasses of
:class:`~libcst.codemod.Codemod`), the stub module from which you wish to add annotations.
:class:`~libcst.codemod.visitors.ApplyTypeAnnotationsVisitor`, then call the static
:meth:`~libcst.codemod.visitors.ApplyTypeAnnotationsVisitor.store_stub_in_context`
method, giving it the current context (found as ``self.context`` for all subclasses
of :class:`~libcst.codemod.Codemod`), the stub module from which you wish to add
annotations.
For example, you can store the type annotation ``int`` for ``x`` using::
Expand All @@ -311,7 +312,8 @@ class ApplyTypeAnnotationsVisitor(ContextAwareTransformer):
x: int = 1
If the function or attribute already has a type annotation, it will not be overwritten.
If the function or attribute already has a type annotation, it will not be
overwritten.
To overwrite existing annotations when applying annotations from a stub,
use the keyword argument ``overwrite_existing_annotations=True`` when
Expand Down

0 comments on commit 138c97c

Please sign in to comment.