Christian Lempa 2 дней назад
Родитель
Сommit
825267c00d
4 измененных файлов с 37 добавлено и 2 удалено
  1. 1 0
      CHANGELOG.md
  2. 2 2
      README.md
  3. 14 0
      cli/modules/bash/__init__.py
  4. 20 0
      tests/test_bash_module.py

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ## [Unreleased]
 
 ### Added
+- Bash template kind for Bash-oriented scripts, bootstrap flows, maintenance tasks, and automation snippets (#1772)
 - Python template kind for Python-oriented project scaffolds, automation helpers, packages, and service/tooling skeletons (#1773)
 - Static template kind for technology-agnostic file and directory boilerplates (#1786)
 - Named generation output paths via `generate --name` / `-n` (#1783)

+ 2 - 2
README.md

@@ -20,9 +20,9 @@ It combines template-defined variables and defaults, guided interactive prompts,
 
 ### Template kinds
 
-Use a dedicated kind when the template's primary output matches that technology. Use `python` for Python-oriented project scaffolds, automation helpers, packages, and service/tooling skeletons. Keep Python files inside another kind, such as `compose` or `terraform`, when they are only supporting files for that primary infrastructure template.
+Use a dedicated kind when the template's primary output matches that technology. Use `python` for Python-oriented project scaffolds, automation helpers, packages, and service/tooling skeletons. Use `bash` for Bash-oriented scripts, bootstrap flows, maintenance tasks, and automation snippets. Keep Python or Bash files inside another kind, such as `compose` or `terraform`, when they are only supporting files for that primary infrastructure template.
 
-Initial `python` validation is intentionally minimal: the CLI validates template syntax, declared variables, rendering, and generic semantic checks where applicable. Python-specific validation such as compilation, formatting, or test execution can be added as a follow-up once template conventions are established.
+Initial `python` and `bash` validation is intentionally minimal: the CLI validates template syntax, declared variables, rendering, and generic semantic checks where applicable. Language-specific validation such as Python compilation, shell syntax checks, formatting, or test execution can be added as follow-up work once template conventions are established.
 
 ### Installation
 

+ 14 - 0
cli/modules/bash/__init__.py

@@ -0,0 +1,14 @@
+"""Bash templates module."""
+
+from ...core.module import Module
+from ...core.registry import registry
+
+
+class BashModule(Module):
+    """Bash templates module."""
+
+    name = "bash"
+    description = "Manage Bash script and automation templates"
+
+
+registry.register(BashModule)

+ 20 - 0
tests/test_bash_module.py

@@ -0,0 +1,20 @@
+"""Tests for the Bash template module."""
+
+from __future__ import annotations
+
+import cli.modules.bash  # noqa: F401 - import registers the module
+from cli.core.registry import registry
+from cli.modules.bash import BashModule
+
+
+def test_bash_module_metadata() -> None:
+    """The Bash module should expose the expected CLI metadata."""
+    assert BashModule.name == "bash"
+    assert BashModule.description == "Manage Bash script and automation templates"
+
+
+def test_bash_module_registers_with_registry() -> None:
+    """Importing the module should make the Bash kind discoverable."""
+    registered_modules = dict(registry.iter_module_classes())
+
+    assert registered_modules["bash"] is BashModule