Skip to content

Commit

Permalink
Rename to mark_safe_typed_dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Nov 7, 2024
1 parent 0055d78 commit d69bec3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions mypy_boto3_builder/generators/base_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _generate_full_stubs_services(self, package: Package) -> None:
service_package = self._parse_service_package(
service_name, package.version, package.data
)
ServicePackageParser.mark_unsafe_typed_dicts(service_package)
ServicePackageParser.mark_safe_typed_dicts(service_package)

service_package.pypi_name = package.pypi_name
service_package.version = package.version
Expand Down Expand Up @@ -204,7 +204,7 @@ def _process_service(
templates_path: Path,
) -> ServicePackage:
service_package = self._parse_service_package(service_name, version, package_data)
ServicePackageParser.mark_unsafe_typed_dicts(service_package)
ServicePackageParser.mark_safe_typed_dicts(service_package)

self.logger.debug(f"Writing {service_name.boto3_name}")
self.package_writer.write_service_package(
Expand Down
4 changes: 2 additions & 2 deletions mypy_boto3_builder/parsers/service_package_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def parse(self) -> ServicePackage:
return result

@staticmethod
def mark_unsafe_typed_dicts(service_package: ServicePackage) -> None:
def mark_safe_typed_dicts(service_package: ServicePackage) -> None:
"""
Mark TypedDicts that can't be rendered as classes safely.
Mark TypedDicts that can be rendered as classes safely.
TypedDict cannot be rendered as class if its name or any attribute is a reserver word,
or if any argument is names as another TypeDef.
Expand Down
16 changes: 8 additions & 8 deletions vulture_whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ actions # unused variable (mypy_boto3_builder/parsers/shape_parser_types.py:104
has # unused variable (mypy_boto3_builder/parsers/shape_parser_types.py:106)
service # unused variable (mypy_boto3_builder/parsers/shape_parser_types.py:114)
resources # unused variable (mypy_boto3_builder/parsers/shape_parser_types.py:115)
_.boto3_version # unused attribute (mypy_boto3_builder/service_name.py:47)
_.import_name # unused property (mypy_boto3_builder/service_name.py:76)
_.extras_name # unused property (mypy_boto3_builder/service_name.py:87)
_.is_conda_forge_available # unused method (mypy_boto3_builder/service_name.py:100)
_.get_md_doc_link # unused method (mypy_boto3_builder/service_name.py:125)
_.boto3_version # unused attribute (mypy_boto3_builder/service_name.py:48)
_.import_name # unused property (mypy_boto3_builder/service_name.py:77)
_.extras_name # unused property (mypy_boto3_builder/service_name.py:88)
_.is_conda_forge_available # unused method (mypy_boto3_builder/service_name.py:101)
_.get_md_doc_link # unused method (mypy_boto3_builder/service_name.py:126)
_.variable_name # unused property (mypy_boto3_builder/structures/class_record.py:91)
_.method_names # unused property (mypy_boto3_builder/structures/class_record.py:98)
_.client_error_class # unused attribute (mypy_boto3_builder/structures/client.py:40)
Expand Down Expand Up @@ -56,7 +56,7 @@ _.essential_service_names # unused property (mypy_boto3_builder/structures/wrap
_.get_init_required_import_records # unused method (mypy_boto3_builder/structures/wrapper_package.py:40)
_.get_session_required_import_records # unused method (mypy_boto3_builder/structures/wrapper_package.py:50)
_.type_hint_annotations # unused property (mypy_boto3_builder/type_annotations/type_def_sortable.py:33)
_.render_attribute # unused method (mypy_boto3_builder/type_annotations/type_typed_dict.py:62)
_.has_both # unused method (mypy_boto3_builder/type_annotations/type_typed_dict.py:211)
_.type_hint_annotations # unused property (mypy_boto3_builder/type_annotations/type_typed_dict.py:290)
_.render_attribute # unused method (mypy_boto3_builder/type_annotations/type_typed_dict.py:61)
_.has_both # unused method (mypy_boto3_builder/type_annotations/type_typed_dict.py:204)
_.type_hint_annotations # unused property (mypy_boto3_builder/type_annotations/type_typed_dict.py:283)
_.type_hint_annotations # unused property (mypy_boto3_builder/type_annotations/type_union.py:148)

0 comments on commit d69bec3

Please sign in to comment.