From c023fa7c4caff3fd2b3946080f9a58b539b10363 Mon Sep 17 00:00:00 2001 From: jimmylai Date: Fri, 12 Jun 2020 18:24:18 -0700 Subject: [PATCH] [typing] enable Pyre strict mode by default (#313) Co-authored-by: Jimmy Lai --- .circleci/.pyre_configuration | 3 +- .pyre_configuration.example | 1 + docs/source/conf.py | 1 + libcst/__init__.py | 1 - libcst/_add_slots.py | 1 - libcst/_batched_visitor.py | 1 - libcst/_exceptions.py | 1 - libcst/_maybe_sentinel.py | 1 - libcst/_metadata_dependent.py | 1 - libcst/_nodes/__init__.py | 1 - libcst/_nodes/base.py | 1 + libcst/_nodes/deep_equals.py | 1 - libcst/_nodes/expression.py | 4 +- libcst/_nodes/internal.py | 1 - libcst/_nodes/module.py | 1 + libcst/_nodes/op.py | 1 - libcst/_nodes/tests/base.py | 1 - libcst/_nodes/tests/test_assert.py | 1 - libcst/_nodes/tests/test_assign.py | 1 - libcst/_nodes/tests/test_atom.py | 1 - libcst/_nodes/tests/test_attribute.py | 1 - libcst/_nodes/tests/test_await.py | 1 - libcst/_nodes/tests/test_binary_op.py | 1 - libcst/_nodes/tests/test_boolean_op.py | 1 - libcst/_nodes/tests/test_call.py | 1 - libcst/_nodes/tests/test_classdef.py | 1 - libcst/_nodes/tests/test_comment.py | 1 - libcst/_nodes/tests/test_comparison.py | 1 - libcst/_nodes/tests/test_cst_node.py | 1 - libcst/_nodes/tests/test_del.py | 1 - libcst/_nodes/tests/test_dict.py | 1 - libcst/_nodes/tests/test_dict_comp.py | 1 - libcst/_nodes/tests/test_docstring.py | 1 - libcst/_nodes/tests/test_else.py | 1 - libcst/_nodes/tests/test_empty_line.py | 1 - libcst/_nodes/tests/test_for.py | 1 - libcst/_nodes/tests/test_funcdef.py | 1 - libcst/_nodes/tests/test_global.py | 1 - libcst/_nodes/tests/test_if.py | 1 - libcst/_nodes/tests/test_ifexp.py | 1 - libcst/_nodes/tests/test_import.py | 1 - libcst/_nodes/tests/test_indented_block.py | 1 - libcst/_nodes/tests/test_lambda.py | 1 - .../tests/test_leaf_small_statements.py | 1 - libcst/_nodes/tests/test_list.py | 1 - libcst/_nodes/tests/test_matrix_multiply.py | 1 - libcst/_nodes/tests/test_module.py | 1 - libcst/_nodes/tests/test_namedexpr.py | 1 - libcst/_nodes/tests/test_newline.py | 1 - libcst/_nodes/tests/test_nonlocal.py | 1 - libcst/_nodes/tests/test_number.py | 1 - libcst/_nodes/tests/test_raise.py | 1 - libcst/_nodes/tests/test_removal_behavior.py | 1 - libcst/_nodes/tests/test_return.py | 1 - libcst/_nodes/tests/test_set.py | 1 - libcst/_nodes/tests/test_simple_comp.py | 1 - libcst/_nodes/tests/test_simple_statement.py | 1 - libcst/_nodes/tests/test_simple_whitespace.py | 1 - libcst/_nodes/tests/test_small_statement.py | 1 - libcst/_nodes/tests/test_subscript.py | 1 - .../_nodes/tests/test_trailing_whitespace.py | 1 - libcst/_nodes/tests/test_try.py | 1 - libcst/_nodes/tests/test_tuple.py | 1 - libcst/_nodes/tests/test_unary_op.py | 1 - libcst/_nodes/tests/test_while.py | 1 - libcst/_nodes/tests/test_with.py | 1 - libcst/_nodes/tests/test_yield.py | 1 - libcst/_nodes/whitespace.py | 1 - libcst/_parser/__init__.py | 2 - libcst/_parser/base_parser.py | 1 - libcst/_parser/conversions/expression.py | 4 + libcst/_parser/conversions/module.py | 1 + libcst/_parser/conversions/params.py | 1 + libcst/_parser/conversions/statement.py | 1 + libcst/_parser/conversions/terminals.py | 1 + libcst/_parser/custom_itertools.py | 1 - libcst/_parser/detect_config.py | 2 +- libcst/_parser/entrypoints.py | 1 - libcst/_parser/grammar.py | 1 - libcst/_parser/parso/pgen2/generator.py | 1 + libcst/_parser/parso/pgen2/grammar_parser.py | 1 + libcst/_parser/parso/python/token.py | 2 +- libcst/_parser/parso/python/tokenize.py | 1 + libcst/_parser/parso/tests/test_fstring.py | 1 + libcst/_parser/parso/tests/test_tokenize.py | 1 + libcst/_parser/parso/tests/test_utils.py | 1 + libcst/_parser/parso/utils.py | 1 - libcst/_parser/production_decorator.py | 1 - libcst/_parser/python_parser.py | 1 + libcst/_parser/tests/test_detect_config.py | 1 - libcst/_parser/tests/test_footer_behavior.py | 1 - libcst/_parser/tests/test_parse_errors.py | 1 - .../_parser/tests/test_whitespace_parser.py | 1 - libcst/_parser/tests/test_wrapped_tokenize.py | 1 + libcst/_parser/types/config.py | 1 - libcst/_parser/types/conversions.py | 2 + libcst/_parser/types/partials.py | 1 - libcst/_parser/types/production.py | 1 - libcst/_parser/types/tests/test_config.py | 1 - libcst/_parser/types/token.py | 1 - libcst/_parser/types/whitespace_state.py | 1 - libcst/_parser/whitespace_parser.py | 1 - libcst/_parser/wrapped_tokenize.py | 1 - libcst/_position.py | 1 - libcst/_removal_sentinel.py | 1 - libcst/_tabs.py | 2 - libcst/_typed_visitor.py | 1 - libcst/_typed_visitor_base.py | 1 - libcst/_types.py | 2 - libcst/_visitors.py | 1 - libcst/codegen/gather.py | 1 - libcst/codegen/gen_matcher_classes.py | 2 - libcst/codegen/gen_type_mapping.py | 2 - libcst/codegen/gen_visitor_functions.py | 2 - libcst/codegen/generate.py | 1 - libcst/codegen/tests/test_codegen_clean.py | 1 - libcst/codegen/transforms.py | 1 - libcst/codemod/__init__.py | 1 - libcst/codemod/_cli.py | 1 - libcst/codemod/_codemod.py | 1 - libcst/codemod/_command.py | 1 - libcst/codemod/_context.py | 1 - libcst/codemod/_runner.py | 1 - libcst/codemod/_testing.py | 1 - libcst/codemod/_visitor.py | 1 - libcst/codemod/commands/__init__.py | 1 - libcst/codemod/commands/add_pyre_directive.py | 1 - .../commands/convert_format_to_fstring.py | 1 - .../convert_namedtuple_to_dataclass.py | 1 - .../convert_percent_format_to_fstring.py | 1 - .../codemod/commands/ensure_import_present.py | 1 - .../codemod/commands/fix_pyre_directives.py | 1 - libcst/codemod/commands/noop.py | 1 - .../codemod/commands/remove_pyre_directive.py | 1 - .../codemod/commands/remove_unused_imports.py | 1 - .../commands/strip_strings_from_types.py | 1 - libcst/codemod/commands/tests/__init__.py | 1 - .../commands/tests/test_add_pyre_directive.py | 1 - .../tests/test_convert_format_to_fstring.py | 1 - .../test_convert_namedtuple_to_dataclass.py | 1 - .../test_convert_percent_format_to_fstring.py | 1 - .../tests/test_ensure_import_present.py | 1 - .../tests/test_fix_pyre_directives.py | 1 - libcst/codemod/commands/tests/test_noop.py | 1 - .../tests/test_remove_pyre_directive.py | 1 - .../tests/test_remove_unused_imports.py | 1 - .../tests/test_strip_strings_from_types.py | 1 - .../tests/test_unnecessary_format_string.py | 1 - .../commands/unnecessary_format_string.py | 1 - libcst/codemod/tests/__init__.py | 1 - libcst/codemod/tests/test_cli.py | 1 - libcst/codemod/tests/test_codemod.py | 1 - libcst/codemod/tests/test_codemod_cli.py | 1 - libcst/codemod/tests/test_metadata.py | 1 - libcst/codemod/tests/test_runner.py | 1 - libcst/codemod/visitors/__init__.py | 1 - libcst/codemod/visitors/_add_imports.py | 1 - .../visitors/_apply_type_annotations.py | 1 - libcst/codemod/visitors/_gather_exports.py | 1 - libcst/codemod/visitors/_gather_imports.py | 1 - libcst/codemod/visitors/_remove_imports.py | 1 - libcst/codemod/visitors/tests/__init__.py | 1 - .../visitors/tests/test_add_imports.py | 1 - .../tests/test_apply_type_annotations.py | 1 - .../visitors/tests/test_gather_exports.py | 1 - .../visitors/tests/test_gather_imports.py | 1 - .../visitors/tests/test_remove_imports.py | 1 - libcst/helpers/__init__.py | 1 - libcst/helpers/_statement.py | 1 - libcst/helpers/_template.py | 1 - libcst/helpers/common.py | 1 - libcst/helpers/expression.py | 1 - libcst/helpers/module.py | 1 - libcst/helpers/tests/test_expression.py | 1 - libcst/helpers/tests/test_module.py | 1 - libcst/helpers/tests/test_statement.py | 1 - libcst/helpers/tests/test_template.py | 1 - libcst/matchers/__init__.py | 1 - libcst/matchers/_decorators.py | 1 - libcst/matchers/_matcher_base.py | 1 - libcst/matchers/_return_types.py | 1 - libcst/matchers/_visitors.py | 1 - libcst/matchers/tests/test_decorators.py | 1 - libcst/matchers/tests/test_extract.py | 1 - libcst/matchers/tests/test_findall.py | 1 - libcst/matchers/tests/test_matchers.py | 1 - .../tests/test_matchers_with_metadata.py | 1 - libcst/matchers/tests/test_replace.py | 1 - libcst/matchers/tests/test_visitors.py | 1 - libcst/metadata/__init__.py | 1 - libcst/metadata/base_provider.py | 1 - .../metadata/expression_context_provider.py | 1 - libcst/metadata/full_repo_manager.py | 2 - libcst/metadata/parent_node_provider.py | 1 - libcst/metadata/position_provider.py | 1 - libcst/metadata/reentrant_codegen.py | 1 - libcst/metadata/scope_provider.py | 1 - libcst/metadata/span_provider.py | 1 - libcst/metadata/tests/__init__.py | 2 - libcst/metadata/tests/test_base_provider.py | 1 - .../tests/test_expression_context_provider.py | 1 - .../metadata/tests/test_full_repo_manager.py | 1 - .../metadata/tests/test_metadata_provider.py | 1 - .../metadata/tests/test_metadata_wrapper.py | 1 - .../tests/test_parent_node_provider.py | 1 - .../metadata/tests/test_position_provider.py | 1 - .../tests/test_qualified_name_provider.py | 1 - .../metadata/tests/test_reentrant_codegen.py | 1 - libcst/metadata/tests/test_scope_provider.py | 1 - libcst/metadata/tests/test_span_provider.py | 1 - .../tests/test_type_inference_provider.py | 1 - libcst/metadata/type_inference_provider.py | 1 - libcst/metadata/wrapper.py | 1 - libcst/testing/utils.py | 1 + libcst/tests/pyre/simple_class.json | 156 +++++++++--------- libcst/tests/pyre/simple_class.py | 1 - libcst/tests/test_batched_visitor.py | 1 - libcst/tests/test_exceptions.py | 1 - libcst/tests/test_fuzz.py | 1 - libcst/tests/test_pyre_integration.py | 3 +- libcst/tests/test_tool.py | 1 - libcst/tests/test_visitor.py | 1 - libcst/tool.py | 1 - stubs/tokenize.pyi | 2 +- 224 files changed, 110 insertions(+), 291 deletions(-) diff --git a/.circleci/.pyre_configuration b/.circleci/.pyre_configuration index c0d9d22eb..7ffbe4d87 100644 --- a/.circleci/.pyre_configuration +++ b/.circleci/.pyre_configuration @@ -7,5 +7,6 @@ ], "exclude": [ ".*/\\.tox/.*" - ] + ], + "strict": true } diff --git a/.pyre_configuration.example b/.pyre_configuration.example index d6331d020..0550aae6c 100644 --- a/.pyre_configuration.example +++ b/.pyre_configuration.example @@ -8,4 +8,5 @@ "exclude": [ ".*/\\.tox/.*" ] + "strict": true } diff --git a/docs/source/conf.py b/docs/source/conf.py index 1cb942e4e..07c7839d4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe # -*- coding: utf-8 -*- # diff --git a/libcst/__init__.py b/libcst/__init__.py index 2dd3ce0fd..39b0f6dc1 100644 --- a/libcst/__init__.py +++ b/libcst/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from libcst._batched_visitor import BatchableCSTVisitor, visit_batched from libcst._exceptions import MetadataException, ParserSyntaxError from libcst._maybe_sentinel import MaybeSentinel diff --git a/libcst/_add_slots.py b/libcst/_add_slots.py index 2df0566a5..706f5d10c 100644 --- a/libcst/_add_slots.py +++ b/libcst/_add_slots.py @@ -2,7 +2,6 @@ # https://github.com/ericvsmith/dataclasses/blob/ae712dd993420d43444f188f452/LICENSE.txt # https://github.com/ericvsmith/dataclasses/blob/ae712dd993420d43444f/dataclass_tools.py -# pyre-strict import dataclasses from typing import Any, Mapping, Type, TypeVar diff --git a/libcst/_batched_visitor.py b/libcst/_batched_visitor.py index 81660efcc..9264c4c9c 100644 --- a/libcst/_batched_visitor.py +++ b/libcst/_batched_visitor.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import inspect from typing import ( TYPE_CHECKING, diff --git a/libcst/_exceptions.py b/libcst/_exceptions.py index 899e575a9..354f67154 100644 --- a/libcst/_exceptions.py +++ b/libcst/_exceptions.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from enum import Enum, auto from typing import Any, Callable, Iterable, Optional, Sequence, Tuple, Union diff --git a/libcst/_maybe_sentinel.py b/libcst/_maybe_sentinel.py index 8209dd6ac..dc968f95e 100644 --- a/libcst/_maybe_sentinel.py +++ b/libcst/_maybe_sentinel.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from enum import Enum, auto diff --git a/libcst/_metadata_dependent.py b/libcst/_metadata_dependent.py index 600fb3b34..c16277135 100644 --- a/libcst/_metadata_dependent.py +++ b/libcst/_metadata_dependent.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import inspect from abc import ABC from contextlib import contextmanager diff --git a/libcst/_nodes/__init__.py b/libcst/_nodes/__init__.py index 3af7950fc..01f1f0916 100644 --- a/libcst/_nodes/__init__.py +++ b/libcst/_nodes/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ This package contains CSTNode and all of the subclasses needed to express Python's full diff --git a/libcst/_nodes/base.py b/libcst/_nodes/base.py index 6478bf2e8..14c0bf392 100644 --- a/libcst/_nodes/base.py +++ b/libcst/_nodes/base.py @@ -449,6 +449,7 @@ def __repr__(self) -> str: return "\n".join(lines) @classmethod + # pyre-fixme[3]: Return annotation cannot be `Any`. def field(cls, *args: object, **kwargs: object) -> Any: """ A helper that allows us to easily use CSTNodes in dataclass constructor diff --git a/libcst/_nodes/deep_equals.py b/libcst/_nodes/deep_equals.py index 9424bbf50..1e18227cc 100644 --- a/libcst/_nodes/deep_equals.py +++ b/libcst/_nodes/deep_equals.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Provides the implementation of `CSTNode.deep_equals`. """ diff --git a/libcst/_nodes/expression.py b/libcst/_nodes/expression.py index 79e6811d8..b58ec2335 100644 --- a/libcst/_nodes/expression.py +++ b/libcst/_nodes/expression.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import re from abc import ABC, abstractmethod @@ -427,6 +426,7 @@ def _visit_and_replace_children(self, visitor: CSTVisitorT) -> "Integer": def _validate(self) -> None: super(Integer, self)._validate() + # pyre-fixme[16]: Module `tokenize` has no attribute `Intnumber`. if not re.fullmatch(INTNUMBER_RE, self.value): raise CSTValidationError("Number is not a valid integer.") @@ -465,6 +465,7 @@ def _visit_and_replace_children(self, visitor: CSTVisitorT) -> "Float": def _validate(self) -> None: super(Float, self)._validate() + # pyre-fixme[16]: Module `tokenize` has no attribute `Floatnumber`. if not re.fullmatch(FLOATNUMBER_RE, self.value): raise CSTValidationError("Number is not a valid float.") @@ -502,6 +503,7 @@ def _visit_and_replace_children(self, visitor: CSTVisitorT) -> "Imaginary": def _validate(self) -> None: super(Imaginary, self)._validate() + # pyre-fixme[16]: Module `tokenize` has no attribute `Imagnumber`. if not re.fullmatch(IMAGNUMBER_RE, self.value): raise CSTValidationError("Number is not a valid imaginary.") diff --git a/libcst/_nodes/internal.py b/libcst/_nodes/internal.py index 7df20b475..4b5c7b001 100644 --- a/libcst/_nodes/internal.py +++ b/libcst/_nodes/internal.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from contextlib import contextmanager from dataclasses import dataclass, field diff --git a/libcst/_nodes/module.py b/libcst/_nodes/module.py index 400d2f6b6..59a4507d8 100644 --- a/libcst/_nodes/module.py +++ b/libcst/_nodes/module.py @@ -80,6 +80,7 @@ def _visit_and_replace_children(self, visitor: CSTVisitorT) -> "Module": has_trailing_newline=self.has_trailing_newline, ) + # pyre-fixme[14]: `visit` overrides method defined in `CSTNode` inconsistently. def visit(self: _ModuleSelfT, visitor: CSTVisitorT) -> _ModuleSelfT: """ Returns the result of running a visitor over this module. diff --git a/libcst/_nodes/op.py b/libcst/_nodes/op.py index 02b14172f..8e927c182 100644 --- a/libcst/_nodes/op.py +++ b/libcst/_nodes/op.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Tuple diff --git a/libcst/_nodes/tests/base.py b/libcst/_nodes/tests/base.py index fd750b9da..1a014442f 100644 --- a/libcst/_nodes/tests/base.py +++ b/libcst/_nodes/tests/base.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import dataclasses from contextlib import ExitStack from dataclasses import dataclass diff --git a/libcst/_nodes/tests/test_assert.py b/libcst/_nodes/tests/test_assert.py index 4e05128c3..4af2e53aa 100644 --- a/libcst/_nodes/tests/test_assert.py +++ b/libcst/_nodes/tests/test_assert.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any diff --git a/libcst/_nodes/tests/test_assign.py b/libcst/_nodes/tests/test_assign.py index 52c13f6a8..aad6f9792 100644 --- a/libcst/_nodes/tests/test_assign.py +++ b/libcst/_nodes/tests/test_assign.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_atom.py b/libcst/_nodes/tests/test_atom.py index 0fc2fdf65..a35790eb2 100644 --- a/libcst/_nodes/tests/test_atom.py +++ b/libcst/_nodes/tests/test_atom.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any diff --git a/libcst/_nodes/tests/test_attribute.py b/libcst/_nodes/tests/test_attribute.py index b2140dfa0..e3c021e3c 100644 --- a/libcst/_nodes/tests/test_attribute.py +++ b/libcst/_nodes/tests/test_attribute.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_await.py b/libcst/_nodes/tests/test_await.py index 16be67647..a07f2c62d 100644 --- a/libcst/_nodes/tests/test_await.py +++ b/libcst/_nodes/tests/test_await.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_binary_op.py b/libcst/_nodes/tests/test_binary_op.py index edaa3588c..50f8ff79e 100644 --- a/libcst/_nodes/tests/test_binary_op.py +++ b/libcst/_nodes/tests/test_binary_op.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_boolean_op.py b/libcst/_nodes/tests/test_boolean_op.py index 5506ec16e..bf63a49d2 100644 --- a/libcst/_nodes/tests/test_boolean_op.py +++ b/libcst/_nodes/tests/test_boolean_op.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_call.py b/libcst/_nodes/tests/test_call.py index a5325642d..c58af9964 100644 --- a/libcst/_nodes/tests/test_call.py +++ b/libcst/_nodes/tests/test_call.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_classdef.py b/libcst/_nodes/tests/test_classdef.py index fe3472832..1f0c4090c 100644 --- a/libcst/_nodes/tests/test_classdef.py +++ b/libcst/_nodes/tests/test_classdef.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_comment.py b/libcst/_nodes/tests/test_comment.py index 46b892b56..793937654 100644 --- a/libcst/_nodes/tests/test_comment.py +++ b/libcst/_nodes/tests/test_comment.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_comparison.py b/libcst/_nodes/tests/test_comparison.py index 1148afdf4..b70dab1e5 100644 --- a/libcst/_nodes/tests/test_comparison.py +++ b/libcst/_nodes/tests/test_comparison.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_cst_node.py b/libcst/_nodes/tests/test_cst_node.py index bbe8c53b6..e3cb7e9ae 100644 --- a/libcst/_nodes/tests/test_cst_node.py +++ b/libcst/_nodes/tests/test_cst_node.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Union diff --git a/libcst/_nodes/tests/test_del.py b/libcst/_nodes/tests/test_del.py index dd76be263..83d97cb48 100644 --- a/libcst/_nodes/tests/test_del.py +++ b/libcst/_nodes/tests/test_del.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_dict.py b/libcst/_nodes/tests/test_dict.py index 0d5292897..425adb790 100644 --- a/libcst/_nodes/tests/test_dict.py +++ b/libcst/_nodes/tests/test_dict.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_dict_comp.py b/libcst/_nodes/tests/test_dict_comp.py index dd5d219be..829cb96fe 100644 --- a/libcst/_nodes/tests/test_dict_comp.py +++ b/libcst/_nodes/tests/test_dict_comp.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_docstring.py b/libcst/_nodes/tests/test_docstring.py index 8596a952c..0f46f2f64 100644 --- a/libcst/_nodes/tests/test_docstring.py +++ b/libcst/_nodes/tests/test_docstring.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Optional diff --git a/libcst/_nodes/tests/test_else.py b/libcst/_nodes/tests/test_else.py index cbeb0a5af..ffaad7524 100644 --- a/libcst/_nodes/tests/test_else.py +++ b/libcst/_nodes/tests/test_else.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_empty_line.py b/libcst/_nodes/tests/test_empty_line.py index b9b068525..ad4c647cb 100644 --- a/libcst/_nodes/tests/test_empty_line.py +++ b/libcst/_nodes/tests/test_empty_line.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import libcst as cst from libcst._nodes.tests.base import CSTNodeTest, DummyIndentedBlock from libcst.testing.utils import data_provider diff --git a/libcst/_nodes/tests/test_for.py b/libcst/_nodes/tests/test_for.py index 321cc3e67..ffc91b48f 100644 --- a/libcst/_nodes/tests/test_for.py +++ b/libcst/_nodes/tests/test_for.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_funcdef.py b/libcst/_nodes/tests/test_funcdef.py index e05d18567..472d30aac 100644 --- a/libcst/_nodes/tests/test_funcdef.py +++ b/libcst/_nodes/tests/test_funcdef.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_global.py b/libcst/_nodes/tests/test_global.py index 7df81739c..038c03683 100644 --- a/libcst/_nodes/tests/test_global.py +++ b/libcst/_nodes/tests/test_global.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_if.py b/libcst/_nodes/tests/test_if.py index 3ccf0c1c1..52dffa33e 100644 --- a/libcst/_nodes/tests/test_if.py +++ b/libcst/_nodes/tests/test_if.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_ifexp.py b/libcst/_nodes/tests/test_ifexp.py index 41bcade13..ef65b9d5c 100644 --- a/libcst/_nodes/tests/test_ifexp.py +++ b/libcst/_nodes/tests/test_ifexp.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_import.py b/libcst/_nodes/tests/test_import.py index 07a604a64..cd56da51c 100644 --- a/libcst/_nodes/tests/test_import.py +++ b/libcst/_nodes/tests/test_import.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_indented_block.py b/libcst/_nodes/tests/test_indented_block.py index 79ca580e3..4397c8643 100644 --- a/libcst/_nodes/tests/test_indented_block.py +++ b/libcst/_nodes/tests/test_indented_block.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_lambda.py b/libcst/_nodes/tests/test_lambda.py index 1c7ff5d63..5ff75f1dc 100644 --- a/libcst/_nodes/tests/test_lambda.py +++ b/libcst/_nodes/tests/test_lambda.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_leaf_small_statements.py b/libcst/_nodes/tests/test_leaf_small_statements.py index 221449344..9ab3e4998 100644 --- a/libcst/_nodes/tests/test_leaf_small_statements.py +++ b/libcst/_nodes/tests/test_leaf_small_statements.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import libcst as cst from libcst._nodes.tests.base import CSTNodeTest from libcst.testing.utils import data_provider diff --git a/libcst/_nodes/tests/test_list.py b/libcst/_nodes/tests/test_list.py index c050af8a5..a4a08b952 100644 --- a/libcst/_nodes/tests/test_list.py +++ b/libcst/_nodes/tests/test_list.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_matrix_multiply.py b/libcst/_nodes/tests/test_matrix_multiply.py index 6a98bee97..9f50dd28a 100644 --- a/libcst/_nodes/tests/test_matrix_multiply.py +++ b/libcst/_nodes/tests/test_matrix_multiply.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_module.py b/libcst/_nodes/tests/test_module.py index 05bd9e402..671a23a61 100644 --- a/libcst/_nodes/tests/test_module.py +++ b/libcst/_nodes/tests/test_module.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Tuple, cast import libcst as cst diff --git a/libcst/_nodes/tests/test_namedexpr.py b/libcst/_nodes/tests/test_namedexpr.py index 34937e45b..b0eccbf1f 100644 --- a/libcst/_nodes/tests/test_namedexpr.py +++ b/libcst/_nodes/tests/test_namedexpr.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_newline.py b/libcst/_nodes/tests/test_newline.py index b0f1239ae..ab5935bf1 100644 --- a/libcst/_nodes/tests/test_newline.py +++ b/libcst/_nodes/tests/test_newline.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_nonlocal.py b/libcst/_nodes/tests/test_nonlocal.py index 634caccb0..86b653014 100644 --- a/libcst/_nodes/tests/test_nonlocal.py +++ b/libcst/_nodes/tests/test_nonlocal.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_number.py b/libcst/_nodes/tests/test_number.py index 9d4db69da..517a97c50 100644 --- a/libcst/_nodes/tests/test_number.py +++ b/libcst/_nodes/tests/test_number.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_raise.py b/libcst/_nodes/tests/test_raise.py index 14c587552..7113357ee 100644 --- a/libcst/_nodes/tests/test_raise.py +++ b/libcst/_nodes/tests/test_raise.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_removal_behavior.py b/libcst/_nodes/tests/test_removal_behavior.py index 23efbcfc6..aeb9745ff 100644 --- a/libcst/_nodes/tests/test_removal_behavior.py +++ b/libcst/_nodes/tests/test_removal_behavior.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Type, Union import libcst as cst diff --git a/libcst/_nodes/tests/test_return.py b/libcst/_nodes/tests/test_return.py index e34020860..75aa587aa 100644 --- a/libcst/_nodes/tests/test_return.py +++ b/libcst/_nodes/tests/test_return.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_set.py b/libcst/_nodes/tests/test_set.py index 4f95b9fdc..434bf0ab0 100644 --- a/libcst/_nodes/tests/test_set.py +++ b/libcst/_nodes/tests/test_set.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_simple_comp.py b/libcst/_nodes/tests/test_simple_comp.py index 613d71d87..cf73176bc 100644 --- a/libcst/_nodes/tests/test_simple_comp.py +++ b/libcst/_nodes/tests/test_simple_comp.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_simple_statement.py b/libcst/_nodes/tests/test_simple_statement.py index 74e556a07..5870e56e3 100644 --- a/libcst/_nodes/tests/test_simple_statement.py +++ b/libcst/_nodes/tests/test_simple_statement.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_simple_whitespace.py b/libcst/_nodes/tests/test_simple_whitespace.py index 71569565b..b571d7f2b 100644 --- a/libcst/_nodes/tests/test_simple_whitespace.py +++ b/libcst/_nodes/tests/test_simple_whitespace.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_small_statement.py b/libcst/_nodes/tests/test_small_statement.py index 2781d3df3..73e5296f4 100644 --- a/libcst/_nodes/tests/test_small_statement.py +++ b/libcst/_nodes/tests/test_small_statement.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_subscript.py b/libcst/_nodes/tests/test_subscript.py index 6e0749317..7e39eb5e5 100644 --- a/libcst/_nodes/tests/test_subscript.py +++ b/libcst/_nodes/tests/test_subscript.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_trailing_whitespace.py b/libcst/_nodes/tests/test_trailing_whitespace.py index 6c7e7c64c..d11d553e5 100644 --- a/libcst/_nodes/tests/test_trailing_whitespace.py +++ b/libcst/_nodes/tests/test_trailing_whitespace.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import libcst as cst from libcst._nodes.tests.base import CSTNodeTest from libcst.testing.utils import data_provider diff --git a/libcst/_nodes/tests/test_try.py b/libcst/_nodes/tests/test_try.py index 5e0d0f97e..b9492a7ad 100644 --- a/libcst/_nodes/tests/test_try.py +++ b/libcst/_nodes/tests/test_try.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_tuple.py b/libcst/_nodes/tests/test_tuple.py index 71b290f9a..f3a49bed8 100644 --- a/libcst/_nodes/tests/test_tuple.py +++ b/libcst/_nodes/tests/test_tuple.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable import libcst as cst diff --git a/libcst/_nodes/tests/test_unary_op.py b/libcst/_nodes/tests/test_unary_op.py index 9bef5fed7..c9dbb53b5 100644 --- a/libcst/_nodes/tests/test_unary_op.py +++ b/libcst/_nodes/tests/test_unary_op.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional import libcst as cst diff --git a/libcst/_nodes/tests/test_while.py b/libcst/_nodes/tests/test_while.py index a0682ed0b..1bdc8976d 100644 --- a/libcst/_nodes/tests/test_while.py +++ b/libcst/_nodes/tests/test_while.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_with.py b/libcst/_nodes/tests/test_with.py index c431593fb..b74487c78 100644 --- a/libcst/_nodes/tests/test_with.py +++ b/libcst/_nodes/tests/test_with.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any import libcst as cst diff --git a/libcst/_nodes/tests/test_yield.py b/libcst/_nodes/tests/test_yield.py index 1dfb75d8c..83263beba 100644 --- a/libcst/_nodes/tests/test_yield.py +++ b/libcst/_nodes/tests/test_yield.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Any, Callable, Optional import libcst as cst diff --git a/libcst/_nodes/whitespace.py b/libcst/_nodes/whitespace.py index b9bc412cd..22182ebe7 100644 --- a/libcst/_nodes/whitespace.py +++ b/libcst/_nodes/whitespace.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import re from abc import ABC, abstractmethod diff --git a/libcst/_parser/__init__.py b/libcst/_parser/__init__.py index 09af7bcf1..626423691 100644 --- a/libcst/_parser/__init__.py +++ b/libcst/_parser/__init__.py @@ -2,5 +2,3 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. - -# pyre-strict diff --git a/libcst/_parser/base_parser.py b/libcst/_parser/base_parser.py index 4c5cd85c9..dc7f75ee0 100644 --- a/libcst/_parser/base_parser.py +++ b/libcst/_parser/base_parser.py @@ -22,7 +22,6 @@ # As a consequence parser may only be used once. # - Supports our custom Token class, instead of `parso.python.tokenize.Token`. -# pyre-strict from dataclasses import dataclass, field from typing import Generic, Iterable, List, Sequence, TypeVar, Union diff --git a/libcst/_parser/conversions/expression.py b/libcst/_parser/conversions/expression.py index afd878fbf..e7c76a923 100644 --- a/libcst/_parser/conversions/expression.py +++ b/libcst/_parser/conversions/expression.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe import re import typing @@ -861,10 +862,13 @@ def convert_atom_basic( elif child.type.name == "NUMBER": # We must determine what type of number it is since we split node # types up this way. + # pyre-fixme[16]: Module `tokenize` has no attribute `Intnumber`. if re.fullmatch(INTNUMBER_RE, child.string): return WithLeadingWhitespace(Integer(child.string), child.whitespace_before) + # pyre-fixme[16]: Module `tokenize` has no attribute `Floatnumber`. elif re.fullmatch(FLOATNUMBER_RE, child.string): return WithLeadingWhitespace(Float(child.string), child.whitespace_before) + # pyre-fixme[16]: Module `tokenize` has no attribute `Imagnumber`. elif re.fullmatch(IMAGNUMBER_RE, child.string): return WithLeadingWhitespace( Imaginary(child.string), child.whitespace_before diff --git a/libcst/_parser/conversions/module.py b/libcst/_parser/conversions/module.py index 17d4c4674..ad3bed667 100644 --- a/libcst/_parser/conversions/module.py +++ b/libcst/_parser/conversions/module.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe from typing import Any, Sequence diff --git a/libcst/_parser/conversions/params.py b/libcst/_parser/conversions/params.py index 1153790e5..597e7ac94 100644 --- a/libcst/_parser/conversions/params.py +++ b/libcst/_parser/conversions/params.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe from typing import Any, List, Optional, Sequence, Union diff --git a/libcst/_parser/conversions/statement.py b/libcst/_parser/conversions/statement.py index 2cc5c5a4c..8ff7ac8fe 100644 --- a/libcst/_parser/conversions/statement.py +++ b/libcst/_parser/conversions/statement.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe from typing import Any, Dict, List, Optional, Sequence, Tuple, Type diff --git a/libcst/_parser/conversions/terminals.py b/libcst/_parser/conversions/terminals.py index 4eb850180..96d9391b5 100644 --- a/libcst/_parser/conversions/terminals.py +++ b/libcst/_parser/conversions/terminals.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe from typing import Any diff --git a/libcst/_parser/custom_itertools.py b/libcst/_parser/custom_itertools.py index 71541cc98..ccbb1a1f0 100644 --- a/libcst/_parser/custom_itertools.py +++ b/libcst/_parser/custom_itertools.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from itertools import zip_longest from typing import Iterable, Iterator, TypeVar diff --git a/libcst/_parser/detect_config.py b/libcst/_parser/detect_config.py index b4ce02f2f..0748762e7 100644 --- a/libcst/_parser/detect_config.py +++ b/libcst/_parser/detect_config.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import itertools import re @@ -48,6 +47,7 @@ def _detect_encoding(source: Union[str, bytes]) -> str: if isinstance(source, str): return "utf-8" + # pyre-fixme[16]: Module `tokenize` has no attribute `detect_encoding`. return py_tokenize_detect_encoding(BytesIO(source).readline)[0] diff --git a/libcst/_parser/entrypoints.py b/libcst/_parser/entrypoints.py index 6e0b54937..1a27e976b 100644 --- a/libcst/_parser/entrypoints.py +++ b/libcst/_parser/entrypoints.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Parser entrypoints define the way users of our API are allowed to interact with the parser. A parser entrypoint should take the source code and some configuration diff --git a/libcst/_parser/grammar.py b/libcst/_parser/grammar.py index 2123f738d..631714e32 100644 --- a/libcst/_parser/grammar.py +++ b/libcst/_parser/grammar.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import re from functools import lru_cache from typing import FrozenSet, Iterator, Mapping, Optional, Tuple, Union diff --git a/libcst/_parser/parso/pgen2/generator.py b/libcst/_parser/parso/pgen2/generator.py index 79c47759b..c08b164f1 100644 --- a/libcst/_parser/parso/pgen2/generator.py +++ b/libcst/_parser/parso/pgen2/generator.py @@ -11,6 +11,7 @@ # # The following changes were made: # - Type stubs were directly applied. +# pyre-unsafe """ This module defines the data structures used to represent a grammar. diff --git a/libcst/_parser/parso/pgen2/grammar_parser.py b/libcst/_parser/parso/pgen2/grammar_parser.py index 2a6dbac85..0d30199d3 100644 --- a/libcst/_parser/parso/pgen2/grammar_parser.py +++ b/libcst/_parser/parso/pgen2/grammar_parser.py @@ -11,6 +11,7 @@ # # The following changes were made: # - Type stubs were directly applied. +# pyre-unsafe from typing import Generator, List, Optional, Tuple diff --git a/libcst/_parser/parso/python/token.py b/libcst/_parser/parso/python/token.py index fe974e991..204ce94d9 100644 --- a/libcst/_parser/parso/python/token.py +++ b/libcst/_parser/parso/python/token.py @@ -12,8 +12,8 @@ # The following changes were made: # - Explicit TokenType references instead of dynamic creation. # - Use dataclasses instead of raw classes. +# pyre-unsafe -# pyre-strict from dataclasses import dataclass diff --git a/libcst/_parser/parso/python/tokenize.py b/libcst/_parser/parso/python/tokenize.py index 80d54e3ce..4b1905cbb 100644 --- a/libcst/_parser/parso/python/tokenize.py +++ b/libcst/_parser/parso/python/tokenize.py @@ -25,6 +25,7 @@ # Basically this is a stripped down version of the standard library module, so # you can read the documentation there. Additionally we included some speed and # memory optimizations here. +# pyre-unsafe from __future__ import absolute_import import itertools as _itertools diff --git a/libcst/_parser/parso/tests/test_fstring.py b/libcst/_parser/parso/tests/test_fstring.py index 304bd10a7..6851e8b11 100644 --- a/libcst/_parser/parso/tests/test_fstring.py +++ b/libcst/_parser/parso/tests/test_fstring.py @@ -12,6 +12,7 @@ # The following changes were made: # - Convert base test to Unittet # - Remove grammar-specific tests +# pyre-unsafe from libcst._parser.parso.python.tokenize import tokenize from libcst._parser.parso.utils import parse_version_string from libcst.testing.utils import UnitTest, data_provider diff --git a/libcst/_parser/parso/tests/test_tokenize.py b/libcst/_parser/parso/tests/test_tokenize.py index 02d96d91e..f2c62d338 100644 --- a/libcst/_parser/parso/tests/test_tokenize.py +++ b/libcst/_parser/parso/tests/test_tokenize.py @@ -12,6 +12,7 @@ # The following changes were made: # - Convert base test to Unittet # - Remove grammar-specific tests +# pyre-unsafe # -*- coding: utf-8 # This file contains Unicode characters. from textwrap import dedent diff --git a/libcst/_parser/parso/tests/test_utils.py b/libcst/_parser/parso/tests/test_utils.py index df14609fd..03ba9a683 100644 --- a/libcst/_parser/parso/tests/test_utils.py +++ b/libcst/_parser/parso/tests/test_utils.py @@ -12,6 +12,7 @@ # The following changes were made: # - Convert base test to Unittet # - Remove grammar-specific tests +# pyre-unsafe from libcst._parser.parso.utils import python_bytes_to_unicode, split_lines from libcst.testing.utils import UnitTest, data_provider diff --git a/libcst/_parser/parso/utils.py b/libcst/_parser/parso/utils.py index 6cf233c40..a6388040b 100644 --- a/libcst/_parser/parso/utils.py +++ b/libcst/_parser/parso/utils.py @@ -16,7 +16,6 @@ # - Make PythonVersionInfo directly usable in hashmaps # - Unroll total ordering because Pyre doesn't understand it -# pyre-strict import re import sys diff --git a/libcst/_parser/production_decorator.py b/libcst/_parser/production_decorator.py index 804ce0c81..c982bc8d9 100644 --- a/libcst/_parser/production_decorator.py +++ b/libcst/_parser/production_decorator.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, Optional, Sequence, TypeVar from libcst._parser.types.conversions import NonterminalConversion diff --git a/libcst/_parser/python_parser.py b/libcst/_parser/python_parser.py index 3a05072be..05ea0b57c 100644 --- a/libcst/_parser/python_parser.py +++ b/libcst/_parser/python_parser.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe from typing import Any, Iterable, Mapping, Sequence diff --git a/libcst/_parser/tests/test_detect_config.py b/libcst/_parser/tests/test_detect_config.py index aa6024c61..a46106dcc 100644 --- a/libcst/_parser/tests/test_detect_config.py +++ b/libcst/_parser/tests/test_detect_config.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import dataclasses from typing import Union diff --git a/libcst/_parser/tests/test_footer_behavior.py b/libcst/_parser/tests/test_footer_behavior.py index 9139fb0c0..23ff4e256 100644 --- a/libcst/_parser/tests/test_footer_behavior.py +++ b/libcst/_parser/tests/test_footer_behavior.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent import libcst as cst diff --git a/libcst/_parser/tests/test_parse_errors.py b/libcst/_parser/tests/test_parse_errors.py index df204d11b..6d651f3b3 100644 --- a/libcst/_parser/tests/test_parse_errors.py +++ b/libcst/_parser/tests/test_parse_errors.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Callable diff --git a/libcst/_parser/tests/test_whitespace_parser.py b/libcst/_parser/tests/test_whitespace_parser.py index d1a4bafad..dcbafa7e0 100644 --- a/libcst/_parser/tests/test_whitespace_parser.py +++ b/libcst/_parser/tests/test_whitespace_parser.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import dataclass from typing import Callable, Sequence, TypeVar diff --git a/libcst/_parser/tests/test_wrapped_tokenize.py b/libcst/_parser/tests/test_wrapped_tokenize.py index 2bd77100c..56bf3dbde 100644 --- a/libcst/_parser/tests/test_wrapped_tokenize.py +++ b/libcst/_parser/tests/test_wrapped_tokenize.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe from typing import Sequence diff --git a/libcst/_parser/types/config.py b/libcst/_parser/types/config.py index 5a417f917..7c76e4c71 100644 --- a/libcst/_parser/types/config.py +++ b/libcst/_parser/types/config.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import abc import codecs diff --git a/libcst/_parser/types/conversions.py b/libcst/_parser/types/conversions.py index e0f38dc8e..d0193624d 100644 --- a/libcst/_parser/types/conversions.py +++ b/libcst/_parser/types/conversions.py @@ -9,5 +9,7 @@ from libcst._parser.types.token import Token +# pyre-fixme[33]: Aliased annotation cannot contain `Any`. NonterminalConversion = Callable[[ParserConfig, Sequence[Any]], Any] +# pyre-fixme[33]: Aliased annotation cannot contain `Any`. TerminalConversion = Callable[[ParserConfig, Token], Any] diff --git a/libcst/_parser/types/partials.py b/libcst/_parser/types/partials.py index ef8377c55..a53f37780 100644 --- a/libcst/_parser/types/partials.py +++ b/libcst/_parser/types/partials.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import dataclass from typing import Generic, Optional, Sequence, TypeVar, Union diff --git a/libcst/_parser/types/production.py b/libcst/_parser/types/production.py index ad68d45c3..bb60014aa 100644 --- a/libcst/_parser/types/production.py +++ b/libcst/_parser/types/production.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import dataclass from typing import Optional diff --git a/libcst/_parser/types/tests/test_config.py b/libcst/_parser/types/tests/test_config.py index 39110bb3d..6c0c0d0b7 100644 --- a/libcst/_parser/types/tests/test_config.py +++ b/libcst/_parser/types/tests/test_config.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable from libcst._parser.types.config import PartialParserConfig diff --git a/libcst/_parser/types/token.py b/libcst/_parser/types/token.py index 054a04611..60ddb2a2e 100644 --- a/libcst/_parser/types/token.py +++ b/libcst/_parser/types/token.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import dataclass from typing import Optional, Tuple diff --git a/libcst/_parser/types/whitespace_state.py b/libcst/_parser/types/whitespace_state.py index 4df9a1110..b5554a2bc 100644 --- a/libcst/_parser/types/whitespace_state.py +++ b/libcst/_parser/types/whitespace_state.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Defines the state object used by the whitespace parser. """ diff --git a/libcst/_parser/whitespace_parser.py b/libcst/_parser/whitespace_parser.py index 35e0ecaad..b9df6c7e1 100644 --- a/libcst/_parser/whitespace_parser.py +++ b/libcst/_parser/whitespace_parser.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Parso doesn't attempt to parse (or even emit tokens for) whitespace or comments that isn't syntatically important. Instead, we're just given the whitespace as a "prefix" of diff --git a/libcst/_parser/wrapped_tokenize.py b/libcst/_parser/wrapped_tokenize.py index 78a5eb6e4..6104757d0 100644 --- a/libcst/_parser/wrapped_tokenize.py +++ b/libcst/_parser/wrapped_tokenize.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Parso's tokenize doesn't give us tokens in the format that we'd ideally like, so this diff --git a/libcst/_position.py b/libcst/_position.py index dcff0cce0..82411402b 100644 --- a/libcst/_position.py +++ b/libcst/_position.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Data structures used for storing position information. diff --git a/libcst/_removal_sentinel.py b/libcst/_removal_sentinel.py index 3e7f68a5d..b8ba8498c 100644 --- a/libcst/_removal_sentinel.py +++ b/libcst/_removal_sentinel.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Used by visitors. This is hoisted into a separate module to avoid some circular dependencies in the definition of CSTNode. diff --git a/libcst/_tabs.py b/libcst/_tabs.py index c18ecc74b..44e245bac 100644 --- a/libcst/_tabs.py +++ b/libcst/_tabs.py @@ -3,8 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict - def expand_tabs(line: str) -> str: """ diff --git a/libcst/_typed_visitor.py b/libcst/_typed_visitor.py index 3f00976a8..06a18a65a 100644 --- a/libcst/_typed_visitor.py +++ b/libcst/_typed_visitor.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict # This file was generated by libcst.codegen.gen_matcher_classes from typing import TYPE_CHECKING, Optional, Union diff --git a/libcst/_typed_visitor_base.py b/libcst/_typed_visitor_base.py index be48210ab..8525b050a 100644 --- a/libcst/_typed_visitor_base.py +++ b/libcst/_typed_visitor_base.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast diff --git a/libcst/_types.py b/libcst/_types.py index fe10ccfc9..98342da88 100644 --- a/libcst/_types.py +++ b/libcst/_types.py @@ -3,8 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict - from typing import TYPE_CHECKING, TypeVar diff --git a/libcst/_visitors.py b/libcst/_visitors.py index b415bd132..1d710ff2c 100644 --- a/libcst/_visitors.py +++ b/libcst/_visitors.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import TYPE_CHECKING, Union from libcst._metadata_dependent import MetadataDependent diff --git a/libcst/codegen/gather.py b/libcst/codegen/gather.py index 59f007d91..fe309b74f 100644 --- a/libcst/codegen/gather.py +++ b/libcst/codegen/gather.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import inspect from collections import defaultdict from collections.abc import Sequence as ABCSequence diff --git a/libcst/codegen/gen_matcher_classes.py b/libcst/codegen/gen_matcher_classes.py index 0c6a95846..cfde98a3c 100644 --- a/libcst/codegen/gen_matcher_classes.py +++ b/libcst/codegen/gen_matcher_classes.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import dataclass, fields from typing import Generator, List, Optional, Sequence, Set, Tuple, Type, Union @@ -455,7 +454,6 @@ def _get_fields(node: Type[cst.CSTNode]) -> Generator[Field, None, None]: ) generated_code.append("# LICENSE file in the root directory of this source tree.") generated_code.append("") -generated_code.append("# pyre-strict") generated_code.append("") generated_code.append("# This file was generated by libcst.codegen.gen_matcher_classes") generated_code.append("from abc import ABC") diff --git a/libcst/codegen/gen_type_mapping.py b/libcst/codegen/gen_type_mapping.py index 7d39581a7..2f6b2a9d8 100644 --- a/libcst/codegen/gen_type_mapping.py +++ b/libcst/codegen/gen_type_mapping.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import List from libcst.codegen.gather import imports, nodebases, nodeuses @@ -17,7 +16,6 @@ ) generated_code.append("# LICENSE file in the root directory of this source tree.") generated_code.append("") -generated_code.append("# pyre-strict") generated_code.append("") generated_code.append("# This file was generated by libcst.codegen.gen_type_mapping") generated_code.append("from typing import Dict as TypingDict, Type, Union") diff --git a/libcst/codegen/gen_visitor_functions.py b/libcst/codegen/gen_visitor_functions.py index 2385eb294..8eec1bc04 100644 --- a/libcst/codegen/gen_visitor_functions.py +++ b/libcst/codegen/gen_visitor_functions.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import fields from typing import List @@ -18,7 +17,6 @@ ) generated_code.append("# LICENSE file in the root directory of this source tree.") generated_code.append("") -generated_code.append("# pyre-strict") generated_code.append("") generated_code.append("# This file was generated by libcst.codegen.gen_matcher_classes") generated_code.append("from typing import Optional, Union, TYPE_CHECKING") diff --git a/libcst/codegen/generate.py b/libcst/codegen/generate.py index c20123efc..c6bf67b39 100644 --- a/libcst/codegen/generate.py +++ b/libcst/codegen/generate.py @@ -8,7 +8,6 @@ # python -m libcst.codegen.generate --help # python -m libcst.codegen.generate visitors -# pyre-strict import argparse import os import os.path diff --git a/libcst/codegen/tests/test_codegen_clean.py b/libcst/codegen/tests/test_codegen_clean.py index 7bfe037b1..dad5166e3 100644 --- a/libcst/codegen/tests/test_codegen_clean.py +++ b/libcst/codegen/tests/test_codegen_clean.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import os import os.path diff --git a/libcst/codegen/transforms.py b/libcst/codegen/transforms.py index afa49be1d..61bbddf58 100644 --- a/libcst/codegen/transforms.py +++ b/libcst/codegen/transforms.py @@ -12,7 +12,6 @@ # use features such as matchers which rely on previously generated # code to function. -# pyre-strict import ast import libcst as cst diff --git a/libcst/codemod/__init__.py b/libcst/codemod/__init__.py index e43eb63a0..b2b2feabe 100644 --- a/libcst/codemod/__init__.py +++ b/libcst/codemod/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod._cli import ( ParallelTransformResult, diff_code, diff --git a/libcst/codemod/_cli.py b/libcst/codemod/_cli.py index 67355a190..b9ffd2804 100644 --- a/libcst/codemod/_cli.py +++ b/libcst/codemod/_cli.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict """ Provides helpers for CLI interaction. """ diff --git a/libcst/codemod/_codemod.py b/libcst/codemod/_codemod.py index fb66d1a74..bae276747 100644 --- a/libcst/codemod/_codemod.py +++ b/libcst/codemod/_codemod.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from abc import ABC, abstractmethod from contextlib import contextmanager from dataclasses import replace diff --git a/libcst/codemod/_command.py b/libcst/codemod/_command.py index f9374b03e..4529be00d 100644 --- a/libcst/codemod/_command.py +++ b/libcst/codemod/_command.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import argparse import inspect from abc import ABC, abstractmethod diff --git a/libcst/codemod/_context.py b/libcst/codemod/_context.py index 2ed21a399..98e57adf7 100644 --- a/libcst/codemod/_context.py +++ b/libcst/codemod/_context.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from dataclasses import dataclass, field from typing import Any, Dict, List, Optional diff --git a/libcst/codemod/_runner.py b/libcst/codemod/_runner.py index e52dec019..a4b68dd49 100644 --- a/libcst/codemod/_runner.py +++ b/libcst/codemod/_runner.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict """ Provides everything needed to run a CodemodCommand. diff --git a/libcst/codemod/_testing.py b/libcst/codemod/_testing.py index 8442e3eb5..75895b10a 100644 --- a/libcst/codemod/_testing.py +++ b/libcst/codemod/_testing.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from textwrap import dedent from typing import Optional, Sequence, Type diff --git a/libcst/codemod/_visitor.py b/libcst/codemod/_visitor.py index f66a0645d..d368b8542 100644 --- a/libcst/codemod/_visitor.py +++ b/libcst/codemod/_visitor.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Mapping import libcst as cst diff --git a/libcst/codemod/commands/__init__.py b/libcst/codemod/commands/__init__.py index 7e2062ff9..602d26857 100644 --- a/libcst/codemod/commands/__init__.py +++ b/libcst/codemod/commands/__init__.py @@ -3,4 +3,3 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict diff --git a/libcst/codemod/commands/add_pyre_directive.py b/libcst/codemod/commands/add_pyre_directive.py index 935688993..165ebb0bc 100644 --- a/libcst/codemod/commands/add_pyre_directive.py +++ b/libcst/codemod/commands/add_pyre_directive.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import re from abc import ABC from typing import Pattern diff --git a/libcst/codemod/commands/convert_format_to_fstring.py b/libcst/codemod/commands/convert_format_to_fstring.py index a7c05028f..92431698a 100644 --- a/libcst/codemod/commands/convert_format_to_fstring.py +++ b/libcst/codemod/commands/convert_format_to_fstring.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import argparse import ast from typing import Generator, List, Optional, Sequence, Set, Tuple diff --git a/libcst/codemod/commands/convert_namedtuple_to_dataclass.py b/libcst/codemod/commands/convert_namedtuple_to_dataclass.py index 80c6eb529..09935b708 100644 --- a/libcst/codemod/commands/convert_namedtuple_to_dataclass.py +++ b/libcst/codemod/commands/convert_namedtuple_to_dataclass.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import List, Optional, Sequence import libcst as cst diff --git a/libcst/codemod/commands/convert_percent_format_to_fstring.py b/libcst/codemod/commands/convert_percent_format_to_fstring.py index 2f2a9aa09..f56b055e5 100644 --- a/libcst/codemod/commands/convert_percent_format_to_fstring.py +++ b/libcst/codemod/commands/convert_percent_format_to_fstring.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import re from typing import Callable, cast diff --git a/libcst/codemod/commands/ensure_import_present.py b/libcst/codemod/commands/ensure_import_present.py index 18f6cb84f..04b1d1292 100644 --- a/libcst/codemod/commands/ensure_import_present.py +++ b/libcst/codemod/commands/ensure_import_present.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import argparse from typing import Generator, Type diff --git a/libcst/codemod/commands/fix_pyre_directives.py b/libcst/codemod/commands/fix_pyre_directives.py index 90e4bbc6d..b5310d8b0 100644 --- a/libcst/codemod/commands/fix_pyre_directives.py +++ b/libcst/codemod/commands/fix_pyre_directives.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Dict, Sequence, Union import libcst diff --git a/libcst/codemod/commands/noop.py b/libcst/codemod/commands/noop.py index 5876f67c4..eef1d897e 100644 --- a/libcst/codemod/commands/noop.py +++ b/libcst/codemod/commands/noop.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst import Module from libcst.codemod import CodemodCommand diff --git a/libcst/codemod/commands/remove_pyre_directive.py b/libcst/codemod/commands/remove_pyre_directive.py index f1f05e6e1..a9d385062 100644 --- a/libcst/codemod/commands/remove_pyre_directive.py +++ b/libcst/codemod/commands/remove_pyre_directive.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import re from abc import ABC from typing import Pattern, Union diff --git a/libcst/codemod/commands/remove_unused_imports.py b/libcst/codemod/commands/remove_unused_imports.py index 15ebbe534..1c38153ff 100644 --- a/libcst/codemod/commands/remove_unused_imports.py +++ b/libcst/codemod/commands/remove_unused_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst import Import, ImportFrom from libcst.codemod import VisitorBasedCodemodCommand diff --git a/libcst/codemod/commands/strip_strings_from_types.py b/libcst/codemod/commands/strip_strings_from_types.py index 499ebc213..eee89fe44 100644 --- a/libcst/codemod/commands/strip_strings_from_types.py +++ b/libcst/codemod/commands/strip_strings_from_types.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Union import libcst diff --git a/libcst/codemod/commands/tests/__init__.py b/libcst/codemod/commands/tests/__init__.py index 7e2062ff9..602d26857 100644 --- a/libcst/codemod/commands/tests/__init__.py +++ b/libcst/codemod/commands/tests/__init__.py @@ -3,4 +3,3 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict diff --git a/libcst/codemod/commands/tests/test_add_pyre_directive.py b/libcst/codemod/commands/tests/test_add_pyre_directive.py index f675a221d..b7fad93d8 100644 --- a/libcst/codemod/commands/tests/test_add_pyre_directive.py +++ b/libcst/codemod/commands/tests/test_add_pyre_directive.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.add_pyre_directive import AddPyreUnsafeCommand diff --git a/libcst/codemod/commands/tests/test_convert_format_to_fstring.py b/libcst/codemod/commands/tests/test_convert_format_to_fstring.py index c9427aa3b..ee1d3cb02 100644 --- a/libcst/codemod/commands/tests/test_convert_format_to_fstring.py +++ b/libcst/codemod/commands/tests/test_convert_format_to_fstring.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.convert_format_to_fstring import ConvertFormatStringCommand diff --git a/libcst/codemod/commands/tests/test_convert_namedtuple_to_dataclass.py b/libcst/codemod/commands/tests/test_convert_namedtuple_to_dataclass.py index 653d2fd4d..675bf58a7 100644 --- a/libcst/codemod/commands/tests/test_convert_namedtuple_to_dataclass.py +++ b/libcst/codemod/commands/tests/test_convert_namedtuple_to_dataclass.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.convert_namedtuple_to_dataclass import ( ConvertNamedTupleToDataclassCommand, diff --git a/libcst/codemod/commands/tests/test_convert_percent_format_to_fstring.py b/libcst/codemod/commands/tests/test_convert_percent_format_to_fstring.py index 0dd79d19b..2e65eac2b 100644 --- a/libcst/codemod/commands/tests/test_convert_percent_format_to_fstring.py +++ b/libcst/codemod/commands/tests/test_convert_percent_format_to_fstring.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.convert_percent_format_to_fstring import ( ConvertPercentFormatStringCommand, diff --git a/libcst/codemod/commands/tests/test_ensure_import_present.py b/libcst/codemod/commands/tests/test_ensure_import_present.py index 5c4ed2554..b389c3bf0 100644 --- a/libcst/codemod/commands/tests/test_ensure_import_present.py +++ b/libcst/codemod/commands/tests/test_ensure_import_present.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.ensure_import_present import EnsureImportPresentCommand diff --git a/libcst/codemod/commands/tests/test_fix_pyre_directives.py b/libcst/codemod/commands/tests/test_fix_pyre_directives.py index e4f6718cd..dea578250 100644 --- a/libcst/codemod/commands/tests/test_fix_pyre_directives.py +++ b/libcst/codemod/commands/tests/test_fix_pyre_directives.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.fix_pyre_directives import FixPyreDirectivesCommand diff --git a/libcst/codemod/commands/tests/test_noop.py b/libcst/codemod/commands/tests/test_noop.py index 7b7318827..827f3a3cc 100644 --- a/libcst/codemod/commands/tests/test_noop.py +++ b/libcst/codemod/commands/tests/test_noop.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.noop import NOOPCommand diff --git a/libcst/codemod/commands/tests/test_remove_pyre_directive.py b/libcst/codemod/commands/tests/test_remove_pyre_directive.py index 01e619e21..06ccb8f8f 100644 --- a/libcst/codemod/commands/tests/test_remove_pyre_directive.py +++ b/libcst/codemod/commands/tests/test_remove_pyre_directive.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.remove_pyre_directive import ( RemovePyreStrictCommand, diff --git a/libcst/codemod/commands/tests/test_remove_unused_imports.py b/libcst/codemod/commands/tests/test_remove_unused_imports.py index 8c500e0bc..c11da4c16 100644 --- a/libcst/codemod/commands/tests/test_remove_unused_imports.py +++ b/libcst/codemod/commands/tests/test_remove_unused_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.remove_unused_imports import RemoveUnusedImportsCommand diff --git a/libcst/codemod/commands/tests/test_strip_strings_from_types.py b/libcst/codemod/commands/tests/test_strip_strings_from_types.py index dce41b7c4..3ec292b93 100644 --- a/libcst/codemod/commands/tests/test_strip_strings_from_types.py +++ b/libcst/codemod/commands/tests/test_strip_strings_from_types.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodTest from libcst.codemod.commands.strip_strings_from_types import StripStringsCommand diff --git a/libcst/codemod/commands/tests/test_unnecessary_format_string.py b/libcst/codemod/commands/tests/test_unnecessary_format_string.py index dfa586852..ebf1977a9 100644 --- a/libcst/codemod/commands/tests/test_unnecessary_format_string.py +++ b/libcst/codemod/commands/tests/test_unnecessary_format_string.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Type from libcst.codemod import Codemod, CodemodTest diff --git a/libcst/codemod/commands/unnecessary_format_string.py b/libcst/codemod/commands/unnecessary_format_string.py index 3d79d0049..a363b43f5 100644 --- a/libcst/codemod/commands/unnecessary_format_string.py +++ b/libcst/codemod/commands/unnecessary_format_string.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import libcst import libcst.matchers as m from libcst.codemod import VisitorBasedCodemodCommand diff --git a/libcst/codemod/tests/__init__.py b/libcst/codemod/tests/__init__.py index 7e2062ff9..602d26857 100644 --- a/libcst/codemod/tests/__init__.py +++ b/libcst/codemod/tests/__init__.py @@ -3,4 +3,3 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict diff --git a/libcst/codemod/tests/test_cli.py b/libcst/codemod/tests/test_cli.py index b722118e6..a4d1404f6 100644 --- a/libcst/codemod/tests/test_cli.py +++ b/libcst/codemod/tests/test_cli.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Optional from libcst.codemod._cli import _calculate_module diff --git a/libcst/codemod/tests/test_codemod.py b/libcst/codemod/tests/test_codemod.py index 100519049..4fb5dbaa1 100644 --- a/libcst/codemod/tests/test_codemod.py +++ b/libcst/codemod/tests/test_codemod.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from unittest import expectedFailure import libcst as cst diff --git a/libcst/codemod/tests/test_codemod_cli.py b/libcst/codemod/tests/test_codemod_cli.py index becf29e8c..6e6e55f17 100644 --- a/libcst/codemod/tests/test_codemod_cli.py +++ b/libcst/codemod/tests/test_codemod_cli.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import subprocess diff --git a/libcst/codemod/tests/test_metadata.py b/libcst/codemod/tests/test_metadata.py index f8fef7697..acd25bf45 100644 --- a/libcst/codemod/tests/test_metadata.py +++ b/libcst/codemod/tests/test_metadata.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from textwrap import dedent import libcst as cst diff --git a/libcst/codemod/tests/test_runner.py b/libcst/codemod/tests/test_runner.py index de0adbcf3..076730554 100644 --- a/libcst/codemod/tests/test_runner.py +++ b/libcst/codemod/tests/test_runner.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from textwrap import dedent from typing import Dict diff --git a/libcst/codemod/visitors/__init__.py b/libcst/codemod/visitors/__init__.py index 83deb2513..97dbeb99e 100644 --- a/libcst/codemod/visitors/__init__.py +++ b/libcst/codemod/visitors/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod.visitors._add_imports import AddImportsVisitor from libcst.codemod.visitors._apply_type_annotations import ApplyTypeAnnotationsVisitor from libcst.codemod.visitors._gather_exports import GatherExportsVisitor diff --git a/libcst/codemod/visitors/_add_imports.py b/libcst/codemod/visitors/_add_imports.py index 929cf8866..aa487dd86 100644 --- a/libcst/codemod/visitors/_add_imports.py +++ b/libcst/codemod/visitors/_add_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from collections import defaultdict from typing import Dict, List, Optional, Sequence, Set, Tuple, Union diff --git a/libcst/codemod/visitors/_apply_type_annotations.py b/libcst/codemod/visitors/_apply_type_annotations.py index 2c9a0f82b..9a8db3d77 100644 --- a/libcst/codemod/visitors/_apply_type_annotations.py +++ b/libcst/codemod/visitors/_apply_type_annotations.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree # -# pyre-strict from dataclasses import dataclass, field from typing import Dict, List, Optional, Sequence, Set, Tuple, Union diff --git a/libcst/codemod/visitors/_gather_exports.py b/libcst/codemod/visitors/_gather_exports.py index e49b042fb..9b28e25d9 100644 --- a/libcst/codemod/visitors/_gather_exports.py +++ b/libcst/codemod/visitors/_gather_exports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Set import libcst diff --git a/libcst/codemod/visitors/_gather_imports.py b/libcst/codemod/visitors/_gather_imports.py index e4c94b3b2..5920890f3 100644 --- a/libcst/codemod/visitors/_gather_imports.py +++ b/libcst/codemod/visitors/_gather_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Dict, List, Sequence, Set, Tuple, Union import libcst diff --git a/libcst/codemod/visitors/_remove_imports.py b/libcst/codemod/visitors/_remove_imports.py index 841812c4c..8c3dc9f85 100644 --- a/libcst/codemod/visitors/_remove_imports.py +++ b/libcst/codemod/visitors/_remove_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Dict, List, Optional, Sequence, Set, Tuple, Union import libcst as cst diff --git a/libcst/codemod/visitors/tests/__init__.py b/libcst/codemod/visitors/tests/__init__.py index 7e2062ff9..602d26857 100644 --- a/libcst/codemod/visitors/tests/__init__.py +++ b/libcst/codemod/visitors/tests/__init__.py @@ -3,4 +3,3 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict diff --git a/libcst/codemod/visitors/tests/test_add_imports.py b/libcst/codemod/visitors/tests/test_add_imports.py index 5ca4747df..cfc4b26b3 100644 --- a/libcst/codemod/visitors/tests/test_add_imports.py +++ b/libcst/codemod/visitors/tests/test_add_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.codemod import CodemodContext, CodemodTest from libcst.codemod.visitors import AddImportsVisitor diff --git a/libcst/codemod/visitors/tests/test_apply_type_annotations.py b/libcst/codemod/visitors/tests/test_apply_type_annotations.py index e32348a72..08f6aa1b2 100644 --- a/libcst/codemod/visitors/tests/test_apply_type_annotations.py +++ b/libcst/codemod/visitors/tests/test_apply_type_annotations.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import textwrap from typing import Type diff --git a/libcst/codemod/visitors/tests/test_gather_exports.py b/libcst/codemod/visitors/tests/test_gather_exports.py index d06e45ca9..410d77d61 100644 --- a/libcst/codemod/visitors/tests/test_gather_exports.py +++ b/libcst/codemod/visitors/tests/test_gather_exports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst import parse_module from libcst.codemod import CodemodContext, CodemodTest from libcst.codemod.visitors import GatherExportsVisitor diff --git a/libcst/codemod/visitors/tests/test_gather_imports.py b/libcst/codemod/visitors/tests/test_gather_imports.py index 03afd6c6c..b1e2c1028 100644 --- a/libcst/codemod/visitors/tests/test_gather_imports.py +++ b/libcst/codemod/visitors/tests/test_gather_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst import parse_module from libcst.codemod import CodemodContext, CodemodTest from libcst.codemod.visitors import GatherImportsVisitor diff --git a/libcst/codemod/visitors/tests/test_remove_imports.py b/libcst/codemod/visitors/tests/test_remove_imports.py index 76c751c66..21932b65e 100644 --- a/libcst/codemod/visitors/tests/test_remove_imports.py +++ b/libcst/codemod/visitors/tests/test_remove_imports.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import libcst as cst import libcst.matchers as m from libcst.codemod import CodemodContext, CodemodTest, VisitorBasedCodemodCommand diff --git a/libcst/helpers/__init__.py b/libcst/helpers/__init__.py index 9b8b00caa..77c4389c2 100644 --- a/libcst/helpers/__init__.py +++ b/libcst/helpers/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from libcst.helpers._statement import ( get_absolute_module_for_import, diff --git a/libcst/helpers/_statement.py b/libcst/helpers/_statement.py index 7dbce4553..4a3825f21 100644 --- a/libcst/helpers/_statement.py +++ b/libcst/helpers/_statement.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Optional import libcst as cst diff --git a/libcst/helpers/_template.py b/libcst/helpers/_template.py index ecfa2cd7e..e3437c1d0 100644 --- a/libcst/helpers/_template.py +++ b/libcst/helpers/_template.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Dict, Mapping, Optional, Set, Union diff --git a/libcst/helpers/common.py b/libcst/helpers/common.py index d18b9fb27..5bf7e4602 100644 --- a/libcst/helpers/common.py +++ b/libcst/helpers/common.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Type from libcst._types import CSTNodeT diff --git a/libcst/helpers/expression.py b/libcst/helpers/expression.py index fb1918723..2a93c5091 100644 --- a/libcst/helpers/expression.py +++ b/libcst/helpers/expression.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Optional, Union import libcst as cst diff --git a/libcst/helpers/module.py b/libcst/helpers/module.py index 044797f93..5f2bddbe3 100644 --- a/libcst/helpers/module.py +++ b/libcst/helpers/module.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from itertools import islice from typing import List diff --git a/libcst/helpers/tests/test_expression.py b/libcst/helpers/tests/test_expression.py index 4d1d7d07c..ca2d35330 100644 --- a/libcst/helpers/tests/test_expression.py +++ b/libcst/helpers/tests/test_expression.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from ast import literal_eval from typing import Optional, Union diff --git a/libcst/helpers/tests/test_module.py b/libcst/helpers/tests/test_module.py index fda8befe1..c5be94d54 100644 --- a/libcst/helpers/tests/test_module.py +++ b/libcst/helpers/tests/test_module.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import libcst from libcst.helpers import insert_header_comments from libcst.testing.utils import UnitTest diff --git a/libcst/helpers/tests/test_statement.py b/libcst/helpers/tests/test_statement.py index 7dfe70bac..8e38f19ed 100644 --- a/libcst/helpers/tests/test_statement.py +++ b/libcst/helpers/tests/test_statement.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Optional import libcst as cst diff --git a/libcst/helpers/tests/test_template.py b/libcst/helpers/tests/test_template.py index eb13e1aea..1847728d5 100644 --- a/libcst/helpers/tests/test_template.py +++ b/libcst/helpers/tests/test_template.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import os from textwrap import dedent diff --git a/libcst/matchers/__init__.py b/libcst/matchers/__init__.py index df13b71ba..25a4d4398 100644 --- a/libcst/matchers/__init__.py +++ b/libcst/matchers/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict # This file was generated by libcst.codegen.gen_matcher_classes from abc import ABC diff --git a/libcst/matchers/_decorators.py b/libcst/matchers/_decorators.py index b341b7d0d..7dd2e7414 100644 --- a/libcst/matchers/_decorators.py +++ b/libcst/matchers/_decorators.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Callable, TypeVar from libcst.matchers._matcher_base import BaseMatcherNode diff --git a/libcst/matchers/_matcher_base.py b/libcst/matchers/_matcher_base.py index e706870e4..16c16d5b9 100644 --- a/libcst/matchers/_matcher_base.py +++ b/libcst/matchers/_matcher_base.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import collections.abc import copy import inspect diff --git a/libcst/matchers/_return_types.py b/libcst/matchers/_return_types.py index 3dbc1d26c..d8a22986a 100644 --- a/libcst/matchers/_return_types.py +++ b/libcst/matchers/_return_types.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict # This file was generated by libcst.codegen.gen_type_mapping from typing import Dict as TypingDict, Type, Union diff --git a/libcst/matchers/_visitors.py b/libcst/matchers/_visitors.py index 6f68300bf..1232191a4 100644 --- a/libcst/matchers/_visitors.py +++ b/libcst/matchers/_visitors.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from inspect import ismethod, signature from typing import ( Any, diff --git a/libcst/matchers/tests/test_decorators.py b/libcst/matchers/tests/test_decorators.py index 5864f7324..c102f2ab5 100644 --- a/libcst/matchers/tests/test_decorators.py +++ b/libcst/matchers/tests/test_decorators.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from ast import literal_eval from textwrap import dedent from typing import List, Set diff --git a/libcst/matchers/tests/test_extract.py b/libcst/matchers/tests/test_extract.py index bdae463bf..2bf45b911 100644 --- a/libcst/matchers/tests/test_extract.py +++ b/libcst/matchers/tests/test_extract.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Tuple import libcst as cst diff --git a/libcst/matchers/tests/test_findall.py b/libcst/matchers/tests/test_findall.py index bb96a85c5..ade99743c 100644 --- a/libcst/matchers/tests/test_findall.py +++ b/libcst/matchers/tests/test_findall.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from textwrap import dedent from typing import Optional, Sequence diff --git a/libcst/matchers/tests/test_matchers.py b/libcst/matchers/tests/test_matchers.py index b6ddd7639..ab1e5cf1e 100644 --- a/libcst/matchers/tests/test_matchers.py +++ b/libcst/matchers/tests/test_matchers.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import libcst as cst import libcst.matchers as m from libcst.matchers import matches diff --git a/libcst/matchers/tests/test_matchers_with_metadata.py b/libcst/matchers/tests/test_matchers_with_metadata.py index 6067b37ba..4e859973d 100644 --- a/libcst/matchers/tests/test_matchers_with_metadata.py +++ b/libcst/matchers/tests/test_matchers_with_metadata.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Sequence, Set, Tuple diff --git a/libcst/matchers/tests/test_replace.py b/libcst/matchers/tests/test_replace.py index 75d3282cd..cc922446e 100644 --- a/libcst/matchers/tests/test_replace.py +++ b/libcst/matchers/tests/test_replace.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict from typing import Dict, Sequence, Union import libcst as cst diff --git a/libcst/matchers/tests/test_visitors.py b/libcst/matchers/tests/test_visitors.py index 3874b2cd8..3fc2c658d 100644 --- a/libcst/matchers/tests/test_visitors.py +++ b/libcst/matchers/tests/test_visitors.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import pickle from typing import Union diff --git a/libcst/metadata/__init__.py b/libcst/metadata/__init__.py index e18e62b80..2e70e9dff 100644 --- a/libcst/metadata/__init__.py +++ b/libcst/metadata/__init__.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from libcst._position import CodePosition, CodeRange from libcst.metadata.base_provider import ( diff --git a/libcst/metadata/base_provider.py b/libcst/metadata/base_provider.py index eeaa26ca7..b2910f5c1 100644 --- a/libcst/metadata/base_provider.py +++ b/libcst/metadata/base_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from pathlib import Path from types import MappingProxyType from typing import ( diff --git a/libcst/metadata/expression_context_provider.py b/libcst/metadata/expression_context_provider.py index 52c03d0ed..c5a1becc8 100644 --- a/libcst/metadata/expression_context_provider.py +++ b/libcst/metadata/expression_context_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from enum import Enum, auto from typing import Optional, Sequence diff --git a/libcst/metadata/full_repo_manager.py b/libcst/metadata/full_repo_manager.py index 7bd5d8ded..e1bf10a16 100644 --- a/libcst/metadata/full_repo_manager.py +++ b/libcst/metadata/full_repo_manager.py @@ -3,8 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict - from pathlib import Path from typing import TYPE_CHECKING, Collection, Dict, List, Mapping diff --git a/libcst/metadata/parent_node_provider.py b/libcst/metadata/parent_node_provider.py index 2919c9438..fa36e94df 100644 --- a/libcst/metadata/parent_node_provider.py +++ b/libcst/metadata/parent_node_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Optional diff --git a/libcst/metadata/position_provider.py b/libcst/metadata/position_provider.py index 3b169754b..7bd1e7134 100644 --- a/libcst/metadata/position_provider.py +++ b/libcst/metadata/position_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import re from contextlib import contextmanager diff --git a/libcst/metadata/reentrant_codegen.py b/libcst/metadata/reentrant_codegen.py index 34450cac1..89e11c93a 100644 --- a/libcst/metadata/reentrant_codegen.py +++ b/libcst/metadata/reentrant_codegen.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from dataclasses import dataclass, field from typing import List, Optional, Sequence diff --git a/libcst/metadata/scope_provider.py b/libcst/metadata/scope_provider.py index 302cdd441..e1ef86051 100644 --- a/libcst/metadata/scope_provider.py +++ b/libcst/metadata/scope_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import abc import builtins diff --git a/libcst/metadata/span_provider.py b/libcst/metadata/span_provider.py index 33002b550..400ec284a 100644 --- a/libcst/metadata/span_provider.py +++ b/libcst/metadata/span_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from contextlib import contextmanager from dataclasses import dataclass, field diff --git a/libcst/metadata/tests/__init__.py b/libcst/metadata/tests/__init__.py index 09af7bcf1..626423691 100644 --- a/libcst/metadata/tests/__init__.py +++ b/libcst/metadata/tests/__init__.py @@ -2,5 +2,3 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. - -# pyre-strict diff --git a/libcst/metadata/tests/test_base_provider.py b/libcst/metadata/tests/test_base_provider.py index a1c92c518..e19a45711 100644 --- a/libcst/metadata/tests/test_base_provider.py +++ b/libcst/metadata/tests/test_base_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import cast import libcst as cst diff --git a/libcst/metadata/tests/test_expression_context_provider.py b/libcst/metadata/tests/test_expression_context_provider.py index 91c3926bc..220b3284c 100644 --- a/libcst/metadata/tests/test_expression_context_provider.py +++ b/libcst/metadata/tests/test_expression_context_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Dict, Optional, cast diff --git a/libcst/metadata/tests/test_full_repo_manager.py b/libcst/metadata/tests/test_full_repo_manager.py index 578bad05d..9e57c7788 100644 --- a/libcst/metadata/tests/test_full_repo_manager.py +++ b/libcst/metadata/tests/test_full_repo_manager.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import json from pathlib import Path from unittest.mock import Mock, patch diff --git a/libcst/metadata/tests/test_metadata_provider.py b/libcst/metadata/tests/test_metadata_provider.py index a0855f344..4f7be175a 100644 --- a/libcst/metadata/tests/test_metadata_provider.py +++ b/libcst/metadata/tests/test_metadata_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from unittest.mock import Mock import libcst as cst diff --git a/libcst/metadata/tests/test_metadata_wrapper.py b/libcst/metadata/tests/test_metadata_wrapper.py index fbf46a317..731a910ff 100644 --- a/libcst/metadata/tests/test_metadata_wrapper.py +++ b/libcst/metadata/tests/test_metadata_wrapper.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Optional diff --git a/libcst/metadata/tests/test_parent_node_provider.py b/libcst/metadata/tests/test_parent_node_provider.py index 6ab4b5060..f5f617f65 100644 --- a/libcst/metadata/tests/test_parent_node_provider.py +++ b/libcst/metadata/tests/test_parent_node_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent diff --git a/libcst/metadata/tests/test_position_provider.py b/libcst/metadata/tests/test_position_provider.py index ad3e1c11b..073745759 100644 --- a/libcst/metadata/tests/test_position_provider.py +++ b/libcst/metadata/tests/test_position_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import Tuple diff --git a/libcst/metadata/tests/test_qualified_name_provider.py b/libcst/metadata/tests/test_qualified_name_provider.py index 27325e9d2..cf7fa68b4 100644 --- a/libcst/metadata/tests/test_qualified_name_provider.py +++ b/libcst/metadata/tests/test_qualified_name_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Collection, Mapping, Optional, Tuple diff --git a/libcst/metadata/tests/test_reentrant_codegen.py b/libcst/metadata/tests/test_reentrant_codegen.py index fa96a1b33..da6b39901 100644 --- a/libcst/metadata/tests/test_reentrant_codegen.py +++ b/libcst/metadata/tests/test_reentrant_codegen.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Callable diff --git a/libcst/metadata/tests/test_scope_provider.py b/libcst/metadata/tests/test_scope_provider.py index 34be54ad9..f84a415c8 100644 --- a/libcst/metadata/tests/test_scope_provider.py +++ b/libcst/metadata/tests/test_scope_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from typing import Mapping, Tuple, cast diff --git a/libcst/metadata/tests/test_span_provider.py b/libcst/metadata/tests/test_span_provider.py index cc2c462e8..600b8820f 100644 --- a/libcst/metadata/tests/test_span_provider.py +++ b/libcst/metadata/tests/test_span_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import libcst as cst from libcst.metadata.span_provider import ( diff --git a/libcst/metadata/tests/test_type_inference_provider.py b/libcst/metadata/tests/test_type_inference_provider.py index 9af17225f..f6c977519 100644 --- a/libcst/metadata/tests/test_type_inference_provider.py +++ b/libcst/metadata/tests/test_type_inference_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import json from pathlib import Path diff --git a/libcst/metadata/type_inference_provider.py b/libcst/metadata/type_inference_provider.py index a59ead8c4..fdbb66115 100644 --- a/libcst/metadata/type_inference_provider.py +++ b/libcst/metadata/type_inference_provider.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import json import subprocess from pathlib import Path diff --git a/libcst/metadata/wrapper.py b/libcst/metadata/wrapper.py index 23740e2a8..208aacfcd 100644 --- a/libcst/metadata/wrapper.py +++ b/libcst/metadata/wrapper.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # -# pyre-strict import textwrap from contextlib import ExitStack diff --git a/libcst/testing/utils.py b/libcst/testing/utils.py index 7ed8122be..cba70ed1d 100644 --- a/libcst/testing/utils.py +++ b/libcst/testing/utils.py @@ -2,6 +2,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# pyre-unsafe import inspect import re diff --git a/libcst/tests/pyre/simple_class.json b/libcst/tests/pyre/simple_class.json index e4de20a27..dc621ff3c 100644 --- a/libcst/tests/pyre/simple_class.json +++ b/libcst/tests/pyre/simple_class.json @@ -3,11 +3,11 @@ { "location": { "start": { - "line": 8, + "line": 7, "column": 19 }, "stop": { - "line": 8, + "line": 7, "column": 27 } }, @@ -16,11 +16,11 @@ { "location": { "start": { - "line": 11, + "line": 10, "column": 6 }, "stop": { - "line": 11, + "line": 10, "column": 10 } }, @@ -29,11 +29,11 @@ { "location": { "start": { - "line": 12, + "line": 11, "column": 8 }, "stop": { - "line": 12, + "line": 11, "column": 16 } }, @@ -42,11 +42,11 @@ { "location": { "start": { - "line": 12, + "line": 11, "column": 17 }, "stop": { - "line": 12, + "line": 11, "column": 21 } }, @@ -55,11 +55,11 @@ { "location": { "start": { - "line": 12, + "line": 11, "column": 23 }, "stop": { - "line": 12, + "line": 11, "column": 24 } }, @@ -68,11 +68,11 @@ { "location": { "start": { - "line": 12, + "line": 11, "column": 26 }, "stop": { - "line": 12, + "line": 11, "column": 29 } }, @@ -81,11 +81,11 @@ { "location": { "start": { - "line": 12, + "line": 11, "column": 34 }, "stop": { - "line": 12, + "line": 11, "column": 38 } }, @@ -94,11 +94,11 @@ { "location": { "start": { - "line": 13, + "line": 12, "column": 8 }, "stop": { - "line": 13, + "line": 12, "column": 12 } }, @@ -107,11 +107,11 @@ { "location": { "start": { - "line": 13, + "line": 12, "column": 8 }, "stop": { - "line": 13, + "line": 12, "column": 19 } }, @@ -120,11 +120,11 @@ { "location": { "start": { - "line": 13, + "line": 12, "column": 21 }, "stop": { - "line": 13, + "line": 12, "column": 24 } }, @@ -133,11 +133,11 @@ { "location": { "start": { - "line": 13, + "line": 12, "column": 27 }, "stop": { - "line": 13, + "line": 12, "column": 28 } }, @@ -146,11 +146,11 @@ { "location": { "start": { - "line": 16, + "line": 15, "column": 6 }, "stop": { - "line": 16, + "line": 15, "column": 19 } }, @@ -159,11 +159,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 8 }, "stop": { - "line": 17, + "line": 16, "column": 17 } }, @@ -172,11 +172,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 18 }, "stop": { - "line": 17, + "line": 16, "column": 22 } }, @@ -185,11 +185,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 24 }, "stop": { - "line": 17, + "line": 16, "column": 25 } }, @@ -198,11 +198,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 27 }, "stop": { - "line": 17, + "line": 16, "column": 30 } }, @@ -211,11 +211,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 35 }, "stop": { - "line": 17, + "line": 16, "column": 43 } }, @@ -224,11 +224,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 35 }, "stop": { - "line": 17, + "line": 16, "column": 49 } }, @@ -237,11 +237,11 @@ { "location": { "start": { - "line": 17, + "line": 16, "column": 44 }, "stop": { - "line": 17, + "line": 16, "column": 48 } }, @@ -250,11 +250,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 15 }, "stop": { - "line": 18, + "line": 17, "column": 42 } }, @@ -263,11 +263,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 16 }, "stop": { - "line": 18, + "line": 17, "column": 20 } }, @@ -276,11 +276,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 16 }, "stop": { - "line": 18, + "line": 17, "column": 23 } }, @@ -289,11 +289,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 28 }, "stop": { - "line": 18, + "line": 17, "column": 29 } }, @@ -302,11 +302,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 33 }, "stop": { - "line": 18, + "line": 17, "column": 38 } }, @@ -315,11 +315,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 33 }, "stop": { - "line": 18, + "line": 17, "column": 41 } }, @@ -328,11 +328,11 @@ { "location": { "start": { - "line": 18, + "line": 17, "column": 39 }, "stop": { - "line": 18, + "line": 17, "column": 40 } }, @@ -341,11 +341,11 @@ { "location": { "start": { - "line": 21, + "line": 20, "column": 0 }, "stop": { - "line": 21, + "line": 20, "column": 9 } }, @@ -354,11 +354,11 @@ { "location": { "start": { - "line": 21, + "line": 20, "column": 12 }, "stop": { - "line": 21, + "line": 20, "column": 25 } }, @@ -367,11 +367,11 @@ { "location": { "start": { - "line": 21, + "line": 20, "column": 12 }, "stop": { - "line": 21, + "line": 20, "column": 27 } }, @@ -380,11 +380,11 @@ { "location": { "start": { - "line": 22, + "line": 21, "column": 0 }, "stop": { - "line": 22, + "line": 21, "column": 5 } }, @@ -393,11 +393,11 @@ { "location": { "start": { - "line": 22, + "line": 21, "column": 7 }, "stop": { - "line": 22, + "line": 21, "column": 21 } }, @@ -406,11 +406,11 @@ { "location": { "start": { - "line": 22, + "line": 21, "column": 24 }, "stop": { - "line": 22, + "line": 21, "column": 33 } }, @@ -419,11 +419,11 @@ { "location": { "start": { - "line": 22, + "line": 21, "column": 24 }, "stop": { - "line": 22, + "line": 21, "column": 43 } }, @@ -432,11 +432,11 @@ { "location": { "start": { - "line": 22, + "line": 21, "column": 24 }, "stop": { - "line": 22, + "line": 21, "column": 46 } }, @@ -445,11 +445,11 @@ { "location": { "start": { - "line": 22, + "line": 21, "column": 44 }, "stop": { - "line": 22, + "line": 21, "column": 45 } }, @@ -458,11 +458,11 @@ { "location": { "start": { - "line": 23, + "line": 22, "column": 4 }, "stop": { - "line": 23, + "line": 22, "column": 8 } }, @@ -471,11 +471,11 @@ { "location": { "start": { - "line": 23, + "line": 22, "column": 12 }, "stop": { - "line": 23, + "line": 22, "column": 17 } }, @@ -484,11 +484,11 @@ { "location": { "start": { - "line": 24, + "line": 23, "column": 4 }, "stop": { - "line": 24, + "line": 23, "column": 8 } }, @@ -497,11 +497,11 @@ { "location": { "start": { - "line": 24, + "line": 23, "column": 4 }, "stop": { - "line": 24, + "line": 23, "column": 15 } }, diff --git a/libcst/tests/pyre/simple_class.py b/libcst/tests/pyre/simple_class.py index 431460e05..2ee2d32fd 100644 --- a/libcst/tests/pyre/simple_class.py +++ b/libcst/tests/pyre/simple_class.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict # fmt: off from typing import Sequence diff --git a/libcst/tests/test_batched_visitor.py b/libcst/tests/test_batched_visitor.py index 73d63c2bd..ee3351f4d 100644 --- a/libcst/tests/test_batched_visitor.py +++ b/libcst/tests/test_batched_visitor.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import cast from unittest.mock import Mock diff --git a/libcst/tests/test_exceptions.py b/libcst/tests/test_exceptions.py index da1bf056f..a1c7d8426 100644 --- a/libcst/tests/test_exceptions.py +++ b/libcst/tests/test_exceptions.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import pickle from textwrap import dedent diff --git a/libcst/tests/test_fuzz.py b/libcst/tests/test_fuzz.py index 98d6867bc..590449c7b 100644 --- a/libcst/tests/test_fuzz.py +++ b/libcst/tests/test_fuzz.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict """ Fuzz-tests for libCST, by Zac Hatfield-Dodds (zac@hypothesis.works) diff --git a/libcst/tests/test_pyre_integration.py b/libcst/tests/test_pyre_integration.py index 4da4836ed..4c18643a1 100644 --- a/libcst/tests/test_pyre_integration.py +++ b/libcst/tests/test_pyre_integration.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict import json from pathlib import Path @@ -66,7 +65,7 @@ def visit_Name(self, node: cst.Name) -> Optional[bool]: # remove this if condition when the type issues are fixed. if not any( node.deep_equals(name) and tup == _tup - for (name, _tup) in {(cst.Name("i"), (18, 21, 18, 22)),} + for (name, _tup) in {(cst.Name("i"), (17, 21, 17, 22)),} ): self.test.assertIn( tup, diff --git a/libcst/tests/test_tool.py b/libcst/tests/test_tool.py index f52e6c44b..b5b4aeeb2 100644 --- a/libcst/tests/test_tool.py +++ b/libcst/tests/test_tool.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from textwrap import dedent from libcst import parse_module diff --git a/libcst/tests/test_visitor.py b/libcst/tests/test_visitor.py index 34e006de9..5bc0510e9 100644 --- a/libcst/tests/test_visitor.py +++ b/libcst/tests/test_visitor.py @@ -3,7 +3,6 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# pyre-strict from typing import List import libcst as cst diff --git a/libcst/tool.py b/libcst/tool.py index 13d8ff679..de626ac38 100644 --- a/libcst/tool.py +++ b/libcst/tool.py @@ -8,7 +8,6 @@ # python -m libcst.tool --help # python -m libcst.tool print python_file.py -# pyre-strict import argparse import dataclasses import distutils.spawn diff --git a/stubs/tokenize.pyi b/stubs/tokenize.pyi index ea203906e..a6f50eea2 100644 --- a/stubs/tokenize.pyi +++ b/stubs/tokenize.pyi @@ -94,4 +94,4 @@ class TokenInfo(Tuple[int, str, Tuple[int, int], Tuple[int, int], int]): def __repr__(self) -> str: ... def detect_encoding(readline: Callable[[], bytes]) -> Tuple[str, Sequence[bytes]]: ... -def tokenize(Callable) -> TokenInfo: ... +def tokenize(Callable[[], bytes]) -> TokenInfo: ...