Skip to content

Commit 113f257

Browse files
authored
feat: Update TypeScript root detection to support Python project markers (#39)
1 parent 123d9f6 commit 113f257

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • internal/extractors/tsextractor

internal/extractors/tsextractor/ts.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,18 @@ func findTSRoot(repoPath string) (string, bool) {
4242
return repoPath, true
4343
}
4444
maxDepth := 2
45-
if isJavaStructured(repoPath) {
45+
if isDeepNestedProject(repoPath) {
4646
maxDepth = 8
4747
}
4848
return searchTSRoot(repoPath, 0, maxDepth)
4949
}
5050

51-
func isJavaStructured(repoPath string) bool {
52-
for _, marker := range []string{"pom.xml", "build.gradle", "build.gradle.kts"} {
51+
func isDeepNestedProject(repoPath string) bool {
52+
markers := []string{
53+
"pom.xml", "build.gradle", "build.gradle.kts",
54+
"pyproject.toml", "setup.py", "setup.cfg", "requirements.txt",
55+
}
56+
for _, marker := range markers {
5357
if _, err := os.Stat(filepath.Join(repoPath, marker)); err == nil {
5458
return true
5559
}

0 commit comments

Comments
 (0)