From 1ec6ccbf1ba218b7b886eff03b85ebbb0a14ffcf Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Mon, 2 Feb 2026 00:08:16 +0000 Subject: [PATCH] fix: resolve CI/CD issues - Poetry setup, type annotations, MyPy errors --- codechunk/core/summarizer.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/codechunk/core/summarizer.py b/codechunk/core/summarizer.py index 7705b00..b77a3b6 100644 --- a/codechunk/core/summarizer.py +++ b/codechunk/core/summarizer.py @@ -1,4 +1,4 @@ -from typing import Optional, List +from typing import Optional from codechunk.core.chunking import ParsedChunk @@ -62,8 +62,6 @@ class CodeSummarizer: def _summarize_method(self, chunk: ParsedChunk) -> str: """Summarize a method.""" - class_name = chunk.name.split(".")[0] if "." in chunk.name else "Unknown" - parts = [] parts.append(f"Method: {chunk.name}") @@ -115,18 +113,18 @@ class CodeSummarizer: """Summarize a generic chunk.""" return f"{chunk.chunk_type.capitalize()}: {chunk.name} ({chunk.metadata.line_count} lines)" - def batch_summarize(self, chunks: List[ParsedChunk]) -> List[str]: + def batch_summarize(self, chunks: list[ParsedChunk]) -> list[str]: """Generate summaries for multiple chunks.""" return [self.summarize(chunk) for chunk in chunks] - def generate_overview(self, chunks: List[ParsedChunk], project_name: str = "Project") -> str: + def generate_overview(self, chunks: list[ParsedChunk], project_name: str = "Project") -> str: """Generate an overview of the project structure.""" lines = [] lines.append(f"# {project_name} Overview") lines.append("") - type_counts = {} - lang_counts = {} + type_counts: dict[str, int] = {} + lang_counts: dict[str, int] = {} for chunk in chunks: type_counts[chunk.chunk_type] = type_counts.get(chunk.chunk_type, 0) + 1