fix: Handle dict format in _get_language_stats
Fixed bug where _get_language_stats expected Path objects but received
dictionaries from results['files'].
Root cause: results['files'] contains dicts with 'language' key, not Path objects
Solution: Changed function to extract language from dict instead of calling detect_language()
Before:
for file_path in files:
lang = detect_language(file_path) # ❌ file_path is dict, not Path
After:
for file_data in files:
lang = file_data.get('language', 'Unknown') # ✅ Extract from dict
Tested: Successfully generated SKILL.md for AstroValley (90 lines, 19 C# files)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -771,11 +771,12 @@ Use this skill when you need to:
|
||||
_generate_references(output_dir)
|
||||
|
||||
|
||||
def _get_language_stats(files: List[Path]) -> Dict[str, int]:
|
||||
"""Count files by language."""
|
||||
def _get_language_stats(files: List[Dict]) -> Dict[str, int]:
|
||||
"""Count files by language from analysis results."""
|
||||
stats = {}
|
||||
for file_path in files:
|
||||
lang = detect_language(file_path)
|
||||
for file_data in files:
|
||||
# files is a list of dicts with 'language' key
|
||||
lang = file_data.get('language', 'Unknown')
|
||||
if lang != 'Unknown':
|
||||
stats[lang] = stats.get(lang, 0) + 1
|
||||
return stats
|
||||
|
||||
Reference in New Issue
Block a user