Skip to content

Commit a91602b

Browse files
committed
fx detect_supported_languages
1 parent ef88e54 commit a91602b

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

codewiki/cli/utils/validation.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,30 @@ def detect_supported_languages(directory: Path) -> List[Tuple[str, int]]:
173173
'C#': ['.cs'],
174174
}
175175

176+
# Directories to exclude from counting
177+
excluded_dirs = {
178+
'node_modules', '__pycache__', '.git', 'build', 'dist',
179+
'.venv', 'venv', 'env', '.env', 'target', 'bin', 'obj',
180+
'.pytest_cache', '.mypy_cache', '.tox', 'coverage',
181+
'htmlcov', '.eggs', '*.egg-info', 'vendor', 'bower_components',
182+
'.idea', '.vscode', '.gradle', '.mvn'
183+
}
184+
185+
def should_exclude_file(file_path: Path) -> bool:
186+
"""Check if file is in an excluded directory."""
187+
parts = file_path.parts
188+
return any(excluded_dir in parts for excluded_dir in excluded_dirs)
189+
176190
language_counts = {}
177191

178192
for language, extensions in language_extensions.items():
179193
count = 0
180194
for ext in extensions:
181-
count += len(list(directory.rglob(f"*{ext}")))
195+
# Filter out files in excluded directories
196+
count += sum(
197+
1 for f in directory.rglob(f"*{ext}")
198+
if f.is_file() and not should_exclude_file(f)
199+
)
182200

183201
if count > 0:
184202
language_counts[language] = count
@@ -199,10 +217,10 @@ def is_top_tier_model(model: str) -> bool:
199217
"""
200218
top_tier_models = [
201219
'claude-opus',
202-
'claude-sonnet-4',
220+
'claude-sonnet',
203221
'gpt-4',
204-
'gpt-4-turbo',
205-
'gemini-1.5-pro',
222+
'gpt-5',
223+
'gemini-2.5',
206224
]
207225

208226
model_lower = model.lower()

0 commit comments

Comments
 (0)