(plugin_name: str, source_path: Path)
| 33 | |
| 34 | |
| 35 | def _validate_plugin_dir_name(plugin_name: str, source_path: Path) -> str: |
| 36 | plugin_name = plugin_name.strip() |
| 37 | plugin_path = Path(plugin_name) |
| 38 | has_separator = "/" in plugin_name or "\\" in plugin_name |
| 39 | if ( |
| 40 | not plugin_name |
| 41 | or plugin_name in {".", ".."} |
| 42 | or plugin_path.is_absolute() |
| 43 | or has_separator |
| 44 | or plugin_path.name != plugin_name |
| 45 | ): |
| 46 | raise click.ClickException( |
| 47 | f"Local plugin {source_path} metadata.yaml has invalid name: {plugin_name}" |
| 48 | ) |
| 49 | return plugin_name |
| 50 | |
| 51 | |
| 52 | def get_git_repo(url: str, target_path: Path, proxy: str | None = None) -> None: |
no outgoing calls
no test coverage detected