INNER CODE UNIT · Python
file_importance
mrwadams/stride-gpt · apps/web/main.py:650
def file_importance(file):
# Lower score means higher importance
if file.path.lower() in ["main.py", "app.py", "index.js", "package.json", "config.json"]:
return 0
if "test" in file.path.lower() or "spec" in file.path.lower():
return 3
if file.path.endswith((".py", ".js", ".ts", ".java", ".go")):
return 1
return 2
code_files.sort(key=file_importance)
# Process files until we reach the token limit
total_tokens = readme_tokens
file_count = len(code_files)
processed_files = 0
for i, file in enumerate(code_files):