From 635d92a9f6cb67e5715809d893c7c462230a9ebd Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Wed, 3 Jul 2024 21:16:49 +0000 Subject: [PATCH] lint --- library_generation/owlbot/synthtool/gcp/common.py | 5 +++-- library_generation/owlbot/synthtool/languages/java.py | 4 +++- library_generation/owlbot/synthtool/sources/templates.py | 1 - library_generation/owlbot/synthtool/transforms.py | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/library_generation/owlbot/synthtool/gcp/common.py b/library_generation/owlbot/synthtool/gcp/common.py index c1723a6161..7bee3589a5 100644 --- a/library_generation/owlbot/synthtool/gcp/common.py +++ b/library_generation/owlbot/synthtool/gcp/common.py @@ -45,8 +45,8 @@ class CommonTemplates: def __init__(self, template_path: Optional[Path] = None): if LOCAL_TEMPLATES is None: - logger.error("env var SYNTHTOOL_TEMPLATES must be set") - sys.exit(1) + logger.error("env var SYNTHTOOL_TEMPLATES must be set") + sys.exit(1) logger.debug(f"Using local templates at {LOCAL_TEMPLATES}") self._template_root = Path(LOCAL_TEMPLATES) self._templates = templates.Templates(self._template_root) @@ -151,6 +151,7 @@ def _get_default_branch_name(repository_name: str) -> str: # the majority of our repositories: return os.getenv("DEFAULT_BRANCH", "master") + def load_partials(files: List[str] = []) -> Dict: """ hand-crafted artisanal markdown can be provided in a .readme-partials.yml. diff --git a/library_generation/owlbot/synthtool/languages/java.py b/library_generation/owlbot/synthtool/languages/java.py index 00fdb903ba..f8fc56e0b8 100644 --- a/library_generation/owlbot/synthtool/languages/java.py +++ b/library_generation/owlbot/synthtool/languages/java.py @@ -350,7 +350,9 @@ def common_templates( ) ) - templates = gcp.common.CommonTemplates(template_path=template_path).java_library(**kwargs) + templates = gcp.common.CommonTemplates(template_path=template_path).java_library( + **kwargs + ) # skip README generation on Kokoro (autosynth) if os.environ.get("KOKORO_ROOT") is not None: diff --git a/library_generation/owlbot/synthtool/sources/templates.py b/library_generation/owlbot/synthtool/sources/templates.py index 8402b3d39b..3ba5391f49 100644 --- a/library_generation/owlbot/synthtool/sources/templates.py +++ b/library_generation/owlbot/synthtool/sources/templates.py @@ -79,4 +79,3 @@ def render(self, subdir: PathOrStr = ".", **kwargs) -> Path: print(f"Skipping: {template_name}") return self.dir - diff --git a/library_generation/owlbot/synthtool/transforms.py b/library_generation/owlbot/synthtool/transforms.py index e51f4668b3..2720fc4bd6 100644 --- a/library_generation/owlbot/synthtool/transforms.py +++ b/library_generation/owlbot/synthtool/transforms.py @@ -28,6 +28,7 @@ logger = logging.getLogger() logger.setLevel(logging.DEBUG) + class MissingSourceError(Exception): pass