fix: resolve CI linting and type checking errors
Some checks failed
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled

This commit is contained in:
2026-02-04 06:28:09 +00:00
parent 9f5a693d5d
commit ca6b0c66f1

View File

@@ -34,9 +34,7 @@ class CodeGenerator:
self.template_engine = template_engine
self.issue_data = issue_data
def generate_all_files(
self, language: str, issue_data: IssueData
) -> list[FileSpec]:
def generate_all_files(self, language: str, issue_data: IssueData) -> list[FileSpec]:
"""Generate all project files.
Args:
@@ -54,9 +52,7 @@ class CodeGenerator:
return files
def _generate_source_files(
self, language: str, context: dict[str, Any]
) -> list[FileSpec]:
def _generate_source_files(self, language: str, context: dict[str, Any]) -> list[FileSpec]:
"""Generate source code files.
Args:
@@ -71,9 +67,7 @@ class CodeGenerator:
for template_name in source_templates:
try:
content = self.template_engine.render(
template_name, context, language
)
content = self.template_engine.render(template_name, context, language)
path = self._get_source_path(template_name, language)
files.append(FileSpec(path=path, content=content))
except ValueError:
@@ -81,9 +75,7 @@ class CodeGenerator:
return files
def _generate_config_files(
self, language: str, context: dict[str, Any]
) -> list[FileSpec]:
def _generate_config_files(self, language: str, context: dict[str, Any]) -> list[FileSpec]:
"""Generate configuration files.
Args:
@@ -98,9 +90,7 @@ class CodeGenerator:
for config_name in config_templates:
try:
content = self.template_engine.render(
config_name, context, language
)
content = self.template_engine.render(config_name, context, language)
files.append(FileSpec(path=config_name, content=content))
except ValueError:
pass
@@ -124,9 +114,7 @@ class CodeGenerator:
todo_items = self.issue_data.get_todo_items()
content = self._generate_todo_content(
language, template_name, todo_items
)
content = self._generate_todo_content(language, template_name, todo_items)
return FileSpec(path=path, content=content)
@@ -150,11 +138,9 @@ class CodeGenerator:
lines.append(f"# TODO: {item}")
if language == "python":
return f'"""{template_name} - {self.issue_data.title}"""\n\n' + "\n".join(
lines
)
return f'"""{template_name} - {self.issue_data.title}"""\n\n' + "\n".join(lines)
elif language in ("javascript",):
return f"/**\n * {template_name}\n */\n\n" + "\n".join(lines)
return f"/**\n * {template_name} \n */\n\n" + "\n".join(lines)
elif language == "go":
return f"// {template_name}\n\n" + "\n".join(lines)
elif language == "rust":
@@ -215,4 +201,4 @@ class CodeGenerator:
return self.template_engine.render(filename, context, language)
except ValueError:
empty_file = self._create_empty_file(filename, language, {})
return empty_file.content
return empty_file.content