소스 검색

Run ruff linting and formatting fixes

Co-authored-by: ChristianLempa <28359525+ChristianLempa@users.noreply.github.com>
copilot-swe-agent[bot] 4 달 전
부모
커밋
35d332beb3
3개의 변경된 파일13개의 추가작업 그리고 14개의 파일을 삭제
  1. 8 9
      cli/core/module/base_commands.py
  2. 3 3
      cli/core/template/__init__.py
  3. 2 2
      cli/core/template/template.py

+ 8 - 9
cli/core/module/base_commands.py

@@ -19,7 +19,6 @@ from ..exceptions import (
 from ..input import InputManager
 from ..template import (
     TEMPLATE_STATUS_DRAFT,
-    TEMPLATE_STATUS_INVALID,
     TEMPLATE_STATUS_PUBLISHED,
     Template,
 )
@@ -88,7 +87,7 @@ def list_templates(module_instance, raw: bool = False) -> list:
                 tags_list = template.metadata.tags or []
                 tags = ", ".join(tags_list) if tags_list else "-"
                 version = str(template.metadata.version) if template.metadata.version else ""
-                
+
                 # Get status and format it
                 status = template.status
                 if status == TEMPLATE_STATUS_PUBLISHED:
@@ -97,7 +96,7 @@ def list_templates(module_instance, raw: bool = False) -> list:
                     status_display = "[dim]Draft[/dim]"
                 else:  # TEMPLATE_STATUS_INVALID
                     status_display = "[red]Invalid[/red]"
-                
+
                 schema = template.schema_version if hasattr(template, "schema_version") else "1.0"
                 library_name = template.metadata.library or ""
                 library_type = template.metadata.library_type or "git"
@@ -105,7 +104,7 @@ def list_templates(module_instance, raw: bool = False) -> list:
                 icon = IconManager.UI_LIBRARY_STATIC if library_type == "static" else IconManager.UI_LIBRARY_GIT
                 color = "yellow" if library_type == "static" else "blue"
                 library_display = f"[{color}]{icon} {library_name}[/{color}]"
-                
+
                 # Apply dimmed style to entire row if draft
                 if status == TEMPLATE_STATUS_DRAFT:
                     template_id = f"[dim]{template.id}[/dim]"
@@ -116,7 +115,7 @@ def list_templates(module_instance, raw: bool = False) -> list:
                     library_display = f"[dim]{icon} {library_name}[/dim]"
                 else:
                     template_id = template.id
-                
+
                 return (template_id, name, tags, version, status_display, schema, library_display)
 
             module_instance.display.data_table(
@@ -157,7 +156,7 @@ def search_templates(module_instance, query: str) -> list:
             tags_list = template.metadata.tags or []
             tags = ", ".join(tags_list) if tags_list else "-"
             version = str(template.metadata.version) if template.metadata.version else ""
-            
+
             # Get status and format it
             status = template.status
             if status == TEMPLATE_STATUS_PUBLISHED:
@@ -166,7 +165,7 @@ def search_templates(module_instance, query: str) -> list:
                 status_display = "[dim]Draft[/dim]"
             else:  # TEMPLATE_STATUS_INVALID
                 status_display = "[red]Invalid[/red]"
-            
+
             schema = template.schema_version if hasattr(template, "schema_version") else "1.0"
             library_name = template.metadata.library or ""
             library_type = template.metadata.library_type or "git"
@@ -174,7 +173,7 @@ def search_templates(module_instance, query: str) -> list:
             icon = IconManager.UI_LIBRARY_STATIC if library_type == "static" else IconManager.UI_LIBRARY_GIT
             color = "yellow" if library_type == "static" else "blue"
             library_display = f"[{color}]{icon} {library_name}[/{color}]"
-            
+
             # Apply dimmed style to entire row if draft
             if status == TEMPLATE_STATUS_DRAFT:
                 template_id = f"[dim]{template.id}[/dim]"
@@ -185,7 +184,7 @@ def search_templates(module_instance, query: str) -> list:
                 library_display = f"[dim]{icon} {library_name}[/dim]"
             else:
                 template_id = template.id
-            
+
             return (template_id, name, tags, version, status_display, schema, library_display)
 
         module_instance.display.data_table(

+ 3 - 3
cli/core/template/__init__.py

@@ -18,6 +18,9 @@ from .variable_collection import VariableCollection
 from .variable_section import VariableSection
 
 __all__ = [
+    "TEMPLATE_STATUS_DRAFT",
+    "TEMPLATE_STATUS_INVALID",
+    "TEMPLATE_STATUS_PUBLISHED",
     "Template",
     "TemplateErrorHandler",
     "TemplateFile",
@@ -25,7 +28,4 @@ __all__ = [
     "Variable",
     "VariableCollection",
     "VariableSection",
-    "TEMPLATE_STATUS_PUBLISHED",
-    "TEMPLATE_STATUS_DRAFT",
-    "TEMPLATE_STATUS_INVALID",
 ]

+ 2 - 2
cli/core/template/template.py

@@ -917,13 +917,13 @@ class Template:
     @property
     def status(self) -> str:
         """Get the status of the template.
-        
+
         Returns:
             Status string: 'published', 'draft', or 'invalid'
         """
         # Check if template is marked as draft in metadata
         if self.metadata.draft:
             return TEMPLATE_STATUS_DRAFT
-        
+
         # Template is published (valid and not draft)
         return TEMPLATE_STATUS_PUBLISHED