Skip to content

Commit 594985f

Browse files
authored
Merge pull request #218 from calchiwo/fix/github-path-normalization
fix: normalize GitHub path input (slashes and separators)
2 parents 1af5126 + f469adc commit 594985f

6 files changed

Lines changed: 16 additions & 7 deletions

File tree

_version.py

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

explain_this_repo/_version.py

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

explain_this_repo/github.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,20 @@ def _request_text(
211211

212212
def _normalize_github_path(file_path: str) -> str:
213213
cleaned = file_path.strip()
214+
214215
while cleaned.startswith("./"):
215216
cleaned = cleaned[2:]
216-
cleaned = cleaned.lstrip("/")
217+
218+
cleaned = cleaned.replace("\\", "/")
219+
220+
while "//" in cleaned:
221+
cleaned = cleaned.replace("//", "/")
222+
223+
cleaned = cleaned.strip("/")
224+
217225
if not cleaned:
218226
raise RuntimeError("GitHub file path is empty.")
227+
219228
return cleaned
220229

221230

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.25.0",
3+
"version": "0.25.3",
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.25.0"
7+
version = "0.25.3"
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)