diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f220e3bd..fb1998415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 0.3.5 - 2020-05-12 + +## Updated + - Expose more granular `Assignments` and `Accesses` for dotted imports in `ScopeProvider`. [#284](https://github.com/Instagram/LibCST/pull/284) + - `get_qualified_names_for` returns the most appropriate qualified name. [#290](https://github.com/Instagram/LibCST/pull/290) + - Surface `SyntaxError` raised by formatter in codemod run. [#288](https://github.com/Instagram/LibCST/pull/288) [#289](https://github.com/Instagram/LibCST/pull/289) + - Rename `ApplyTypeAnnotationsVisitor.add_stub_to_context` as `ApplyTypeAnnotationsVisitor.store_stub_in_context` and add `overwrite_existing_annotations` to allow overwrite existing type annotations. [#289](https://github.com/Instagram/LibCST/pull/291) + +## Fixed + - Close opened file handles on finishing codemod to avoid `Too many open files` on OSX. [#283](https://github.com/Instagram/LibCST/pull/283) + +## Deprecated + - `ApplyTypeAnnotationsVisitor.add_stub_to_context` is renamed as `ApplyTypeAnnotationsVisitor.store_stub_in_context`. + # 0.3.4 - 2020-03-27 ## Added diff --git a/libcst/_version.py b/libcst/_version.py index 48ad11f79..5cffd4694 100644 --- a/libcst/_version.py +++ b/libcst/_version.py @@ -4,4 +4,4 @@ # LICENSE file in the root directory of this source tree. -LIBCST_VERSION: str = "0.3.4" +LIBCST_VERSION: str = "0.3.5" diff --git a/libcst/codemod/visitors/_apply_type_annotations.py b/libcst/codemod/visitors/_apply_type_annotations.py index 39754af70..2c9a0f82b 100644 --- a/libcst/codemod/visitors/_apply_type_annotations.py +++ b/libcst/codemod/visitors/_apply_type_annotations.py @@ -249,6 +249,17 @@ def __init__( # insert top-level annotations. self.import_statements: List[cst.ImportFrom] = [] + @staticmethod + def store_stub_in_context( + context: CodemodContext, + stub: cst.Module, + overwrite_existing_annotations: bool = False, + ) -> None: + # deprecated, should be removed in 0.4 release. + ApplyTypeAnnotationsVisitor.store_stub_in_context( + context, stub, overwrite_existing_annotations + ) + @staticmethod def store_stub_in_context( context: CodemodContext,