fix: resolve CI linting and type checking errors
This commit is contained in:
@@ -49,9 +49,9 @@ class StructureGenerator:
|
||||
base_path = Path(self.output_dir) / project_name
|
||||
|
||||
if self.preview:
|
||||
print(f"\n{'='*60}")
|
||||
print(f"\n{'=' * 60}")
|
||||
print(f"PREVIEW: Project would be created at: {base_path}")
|
||||
print(f"{'='*60}\n")
|
||||
print(f"{'=' * 60}\n")
|
||||
|
||||
files = code_generator.generate_all_files(language, issue_data)
|
||||
|
||||
@@ -66,9 +66,7 @@ class StructureGenerator:
|
||||
if self.preview:
|
||||
self._print_preview_summary()
|
||||
|
||||
def _create_directories(
|
||||
self, base_path: Path, issue_data: IssueData
|
||||
) -> None:
|
||||
def _create_directories(self, base_path: Path, issue_data: IssueData) -> None:
|
||||
"""Create project directories.
|
||||
|
||||
Args:
|
||||
@@ -127,9 +125,7 @@ class StructureGenerator:
|
||||
except OSError as e:
|
||||
raise OSError(f"Failed to write file {file_path}: {e}")
|
||||
|
||||
def _create_readme(
|
||||
self, base_path: Path, issue_data: IssueData, project_name: str
|
||||
) -> None:
|
||||
def _create_readme(self, base_path: Path, issue_data: IssueData, project_name: str) -> None:
|
||||
"""Create README.md file.
|
||||
|
||||
Args:
|
||||
@@ -143,7 +139,7 @@ class StructureGenerator:
|
||||
|
||||
## Description
|
||||
|
||||
{issue_data.body[:500]}{'...' if len(issue_data.body) > 500 else ''}
|
||||
{issue_data.body[:500]}{"..." if len(issue_data.body) > 500 else ""}
|
||||
|
||||
**GitHub Issue:** #{issue_data.number}
|
||||
**Repository:** {issue_data.repository}
|
||||
@@ -151,13 +147,19 @@ class StructureGenerator:
|
||||
|
||||
## Requirements
|
||||
|
||||
{chr(10).join(f"- {req}" for req in issue_data.requirements)
|
||||
if issue_data.requirements else "- See GitHub issue for requirements"}
|
||||
{"
|
||||
".join(f"- {req}" for req in issue_data.requirements)
|
||||
if issue_data.requirements
|
||||
else "- See GitHub issue for requirements"
|
||||
}
|
||||
|
||||
## TODO Items
|
||||
|
||||
{chr(10).join(f"- [ ] {item}" for item in issue_data.get_todo_items())
|
||||
if issue_data.get_todo_items() else "- No TODO items found"}
|
||||
{"
|
||||
".join(f"- [ ] {item}" for item in issue_data.get_todo_items())
|
||||
if issue_data.get_todo_items()
|
||||
else "- No TODO items found"
|
||||
}
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -185,9 +187,7 @@ MIT
|
||||
FileSpec(path="README.md", content=readme_content),
|
||||
)
|
||||
|
||||
def _create_gitignore(
|
||||
self, base_path: Path, project_name: str, language: str
|
||||
) -> None:
|
||||
def _create_gitignore(self, base_path: Path, project_name: str, language: str) -> None:
|
||||
"""Create .gitignore file based on language.
|
||||
|
||||
Args:
|
||||
@@ -249,18 +249,19 @@ Cargo.lock
|
||||
Sanitized name.
|
||||
"""
|
||||
import re
|
||||
|
||||
name = re.sub(r"[^a-zA-Z0-9\s_-]", "", name)
|
||||
name = re.sub(r"\s+", "-", name.strip())
|
||||
return name.lower()[:50] or "project"
|
||||
|
||||
def _print_preview_summary(self) -> None:
|
||||
"""Print a summary of what would be created in preview mode."""
|
||||
print(f"\n{'='*60}")
|
||||
print(f"\n{'=' * 60}")
|
||||
print("PREVIEW SUMMARY")
|
||||
print(f"{'='*60}")
|
||||
print(f"{'=' * 60}")
|
||||
print(f"Directories: {len(self.created_dirs)}")
|
||||
print(f"Files: {len(self.created_files)}")
|
||||
print(f"{'='*60}\n")
|
||||
print(f"{'=' * 60}\n")
|
||||
|
||||
def get_created_files(self) -> list[str]:
|
||||
"""Get list of created files."""
|
||||
@@ -268,4 +269,4 @@ Cargo.lock
|
||||
|
||||
def get_created_directories(self) -> list[str]:
|
||||
"""Get list of created directories."""
|
||||
return self.created_dirs.copy()
|
||||
return self.created_dirs.copy()
|
||||
Reference in New Issue
Block a user