Skip to content

Commit 5cc8424

Browse files
authored
Merge branch 'main' into refactor/cli-async-await
2 parents 44a2117 + d721b00 commit 5cc8424

File tree

12 files changed

+369
-375
lines changed

12 files changed

+369
-375
lines changed

src/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
from pathlib import Path
44

5+
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10 MB
6+
MAX_DIRECTORY_DEPTH = 20 # Maximum depth of directory traversal
7+
MAX_FILES = 10_000 # Maximum number of files to process
8+
MAX_TOTAL_SIZE_BYTES = 500 * 1024 * 1024 # 500 MB
9+
510
MAX_DISPLAY_SIZE: int = 300_000
611
TMP_BASE_PATH = Path("/tmp/gitingest")
712
DELETE_REPO_AFTER: int = 60 * 60 # In seconds

src/gitingest/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import click
88

9-
from gitingest.query_ingestion import MAX_FILE_SIZE
9+
from config import MAX_FILE_SIZE
1010
from gitingest.repository_ingest import ingest
1111

1212

@@ -80,8 +80,8 @@ async def _async_main(
8080
"""
8181
try:
8282
# Combine default and custom ignore patterns
83-
exclude_patterns = list(exclude_pattern)
84-
include_patterns = list(set(include_pattern))
83+
exclude_patterns = set(exclude_pattern)
84+
include_patterns = set(include_pattern)
8585

8686
if not output:
8787
output = "digest.txt"
@@ -92,7 +92,7 @@ async def _async_main(
9292
click.echo(summary)
9393

9494
except Exception as e:
95-
click.echo(f"Error: {str(e)}", err=True)
95+
click.echo(f"Error: {e}", err=True)
9696
raise click.Abort()
9797

9898

src/gitingest/ignore_patterns.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
""" Default ignore patterns for Gitingest. """
22

3-
DEFAULT_IGNORE_PATTERNS: list[str] = [
3+
DEFAULT_IGNORE_PATTERNS: set[str] = {
44
# Python
55
"*.pyc",
66
"*.pyo",
@@ -29,18 +29,17 @@
2929
"*.war",
3030
"*.ear",
3131
"*.nar",
32-
"target/",
3332
".gradle/",
3433
"build/",
3534
".settings/",
36-
".project",
3735
".classpath",
3836
"gradle-app.setting",
3937
"*.gradle",
38+
# IDEs and editors / Java
39+
".project",
4040
# C/C++
4141
"*.o",
4242
"*.obj",
43-
"*.so",
4443
"*.dll",
4544
"*.dylib",
4645
"*.exe",
@@ -68,21 +67,22 @@
6867
".ruby-gemset",
6968
".rvmrc",
7069
# Rust
71-
"target/",
7270
"Cargo.lock",
7371
"**/*.rs.bk",
72+
# Java / Rust
73+
"target/",
7474
# Go
75-
"bin/",
7675
"pkg/",
7776
# .NET/C#
78-
"bin/",
7977
"obj/",
8078
"*.suo",
8179
"*.user",
8280
"*.userosscache",
8381
"*.sln.docstates",
8482
"packages/",
8583
"*.nupkg",
84+
# Go / .NET / C#
85+
"bin/",
8686
# Version control
8787
".git",
8888
".svn",
@@ -112,12 +112,9 @@
112112
".idea",
113113
".vscode",
114114
".vs",
115-
"*.swp",
116115
"*.swo",
117116
"*.swn",
118117
".settings",
119-
".project",
120-
".classpath",
121118
"*.sublime-*",
122119
# Temporary and cache files
123120
"*.log",
@@ -140,9 +137,6 @@
140137
"*.egg",
141138
"*.whl",
142139
"*.so",
143-
"*.dylib",
144-
"*.dll",
145-
"*.class",
146140
# Documentation
147141
"site-packages",
148142
".docusaurus",
@@ -159,4 +153,4 @@
159153
"*.tfstate*",
160154
## Dependencies in various languages
161155
"vendor/",
162-
]
156+
}

0 commit comments

Comments
 (0)