Skip to content

Commit 6fd8545

Browse files
authored
Merge pull request #213 from calchiwo/fix/local-stack-detector
fix: prevent local --stack crash on string tree paths
2 parents e540cc6 + acbd7cb commit 6fd8545

7 files changed

Lines changed: 19 additions & 18 deletions

File tree

_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.22.0"
1+
VERSION = "0.22.5"

explain_this_repo/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "0.22.0"
1+
VERSION = "0.22.5"

explain_this_repo/cli.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
from explain_this_repo.generate import generate_explanation
1414
from explain_this_repo.github import fetch_languages, fetch_readme, fetch_repo
1515
from explain_this_repo.local_reader import read_local_repo_signal_files
16-
from explain_this_repo.prompt import (
17-
build_file_prompt,
18-
build_file_quick_prompt,
19-
build_file_simple_prompt,
20-
build_prompt,
21-
build_quick_prompt,
22-
build_simple_prompt,
23-
)
16+
from explain_this_repo.prompt import (build_file_prompt,
17+
build_file_quick_prompt,
18+
build_file_simple_prompt, build_prompt,
19+
build_quick_prompt, build_simple_prompt)
2420
from explain_this_repo.repo_reader import read_repo_signal_files
2521
from explain_this_repo.stack_detector import detect_stack
2622
from explain_this_repo.stack_printer import print_stack
@@ -671,4 +667,4 @@ def _run():
671667

672668

673669
if __name__ == "__main__":
674-
_run()
670+
_run()

explain_this_repo/stack_detector.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
from __future__ import annotations
22

3-
from typing import Dict, List
3+
from typing import Any, Dict, List
44

55
StackReport = Dict[str, List[str]]
66

77

88
def detect_stack(
9-
languages: Dict[str, int], tree: list[dict], key_files: Dict[str, str]
9+
languages: Dict[str, int],
10+
tree: list[dict[str, Any] | str],
11+
key_files: Dict[str, str],
1012
) -> StackReport:
1113
report: StackReport = {
1214
"languages": [],
@@ -22,7 +24,10 @@ def detect_stack(
2224
report["languages"] = sorted(languages.keys())
2325

2426
# --- Package managers ---
25-
paths = {item.get("path", "").lower() for item in tree}
27+
paths = {
28+
item.lower() if isinstance(item, str) else item.get("path", "").lower()
29+
for item in tree
30+
}
2631

2732
if "pnpm-lock.yaml" in paths:
2833
report["package_managers"].append("pnpm")

node_version/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_version/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "explainthisrepo",
3-
"version": "0.22.0",
3+
"version": "0.22.5",
44
"description": "The fastest way to understand any codebase in plain English. Not blind AI summarization",
55
"license": "MIT",
66
"type": "module",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "explainthisrepo"
7-
version = "0.22.0"
7+
version = "0.22.5"
88
description = "The fastest way to understand any codebase in plain English using real project signals. Not blind AI summarization"
99
readme = { file = "README.md", content-type = "text/markdown" }
1010
requires-python = ">=3.9,<4.0"

0 commit comments

Comments
 (0)