From 3f7ef53be964639fbe034ceaf30cbea5500e55fe Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 05:56:51 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`add-mul?= =?UTF-8?q?tiple-cloud-support`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @SatyendraGollaFacets. * https://github.com/Facets-cloud/module-development-cli/pull/80#issuecomment-3471438651 The following files were modified: * `ftf_cli/commands/generate_module.py` --- ftf_cli/commands/generate_module.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/ftf_cli/commands/generate_module.py b/ftf_cli/commands/generate_module.py index b8c59e6..1551bf5 100644 --- a/ftf_cli/commands/generate_module.py +++ b/ftf_cli/commands/generate_module.py @@ -22,7 +22,24 @@ help="The version of the module. If not provided, the default version will be 1.0. and the module will increment the version number.", ) def generate_module(path, intent, flavor, cloud, title, description, version): - """Generate a new module.""" + """ + Generate a new module by rendering built-in templates into a target directory. + + Parameters: + path (str): Destination base path where the module directory will be created. + intent (str): Intent name used to construct the module path and passed to templates. + flavor (str): Flavor name used to construct the module path and passed to templates. + cloud (str): Cloud identifier or comma-separated list of clouds (e.g., "aws" or "aws,azure"). + title (str): Human-readable title passed into templates. + description (str): Description text passed into templates. + version (str): Version identifier appended to the module path; must not be a digits-only string. + + Raises: + click.UsageError: If `version` is digits-only, if the requested version already exists, or if version parsing fails when attempting to suggest an alternate version. + + Side effects: + Creates the module directory (including parent directories) and writes rendered template files into it. + """ if str(version).isdigit(): raise click.UsageError( f"❌ Version {version} is not a valid version. Use a valid version like 1.0" @@ -81,4 +98,4 @@ def generate_module(path, intent, flavor, cloud, title, description, version): ) # Remove .j2 to get the real file name with open(os.path.join(module_path, file_name), "w", encoding='utf-8') as f: f.write(rendered_content) - click.echo(f"✅ Module generated at: {module_path}") + click.echo(f"✅ Module generated at: {module_path}") \ No newline at end of file