From c849b4db69875cbc41e63acb61be81afd626317a Mon Sep 17 00:00:00 2001 From: Brian Lao Date: Mon, 25 Nov 2024 11:26:10 -0500 Subject: [PATCH] WIP --- src/rpdk/core/project.py | 20 ++++++++++++-------- tests/test_project.py | 7 ++++++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/rpdk/core/project.py b/src/rpdk/core/project.py index aff48cfa..f11cec83 100644 --- a/src/rpdk/core/project.py +++ b/src/rpdk/core/project.py @@ -840,13 +840,15 @@ def generate_docs(self): target_names = ( self.target_info.keys() if self.target_info - else { - target_name - for handler in self.schema.get("handlers", {}).values() - for target_name in handler.get("targetNames", []) - } - if self.artifact_type == ARTIFACT_TYPE_HOOK - else [] + else ( + { + target_name + for handler in self.schema.get("handlers", {}).values() + for target_name in handler.get("targetNames", []) + } + if self.artifact_type == ARTIFACT_TYPE_HOOK + else [] + ) ) LOG.debug("Removing generated docs: %s", docs_path) @@ -1286,7 +1288,9 @@ def _load_target_info( LOG.debug("Hook schema target names: %s", str(target_names)) if self.artifact_type == ARTIFACT_TYPE_HOOK: - target_names = list(filter(lambda x: x not in HOOK_SPECIAL_TARGET_NAMES, target_names)) + target_names = list( + filter(lambda x: x not in HOOK_SPECIAL_TARGET_NAMES, target_names) + ) if local_only: targets = TypeNameResolver.resolve_type_names_locally( diff --git a/tests/test_project.py b/tests/test_project.py index f8b9cb51..c4aa6f1c 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -2443,7 +2443,12 @@ def test__load_target_info_for_hooks(project): project.schema = { "handlers": { "preCreate": { - "targetNames": ["AWS::TestHook::Target", "AWS::TestHook::OtherTarget", "STACK", "CHANGE_SET"] + "targetNames": [ + "AWS::TestHook::Target", + "AWS::TestHook::OtherTarget", + "STACK", + "CHANGE_SET", + ] }, "preUpdate": { "targetNames": [