Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Oct 4, 2023
1 parent f03372d commit 6d5cac1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions synthtool/gcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ def _generic_library(
partial_files: List[str] = None,
**kwargs,
) -> Path:
# load default values that used to render templates.
defaults_path = self._template_root / directory / "defaults"
kwargs["metadata"]["defaults"] = {}
for default_file in defaults_path.glob("*-default.yaml"):
self.excludes.append("defaults/{}".format(os.path.basename(default_file)))
with open(default_file) as f:
kwargs["metadata"]["defaults"].update(
yaml.load(f, Loader=yaml.SafeLoader)
)
if defaults_path.exists():
kwargs["metadata"]["defaults"] = {}
for default_file in defaults_path.glob("*-default.yaml"):
self.excludes.append("defaults/{}".format(os.path.basename(default_file)))
with open(default_file) as f:
kwargs["metadata"]["defaults"].update(
yaml.load(f, Loader=yaml.SafeLoader)
)
# load common repo meta information (metadata that's not language
# specific).
if "metadata" in kwargs:
Expand Down
3 changes: 2 additions & 1 deletion synthtool/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ def common_templates(
Args:
:param excludes: List of template paths to ignore
:param template_path:
:param partial_files:
:param partial_files: List of partial files to save customizations on
templates
:param kwargs: Additional options for CommonTemplates.java_library()
"""
Expand Down

0 comments on commit 6d5cac1

Please sign in to comment.