Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlaoaws committed Nov 25, 2024
1 parent 8f4daa9 commit c849b4d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
20 changes: 12 additions & 8 deletions src/rpdk/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 6 additions & 1 deletion tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit c849b4d

Please sign in to comment.