-
Notifications
You must be signed in to change notification settings - Fork 251
fix(loader): repo-relative ignore matching + deterministic local defaults #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,11 +14,54 @@ repository: | |||||||||||||||||||
| - "__pycache__" | ||||||||||||||||||||
| - "node_modules" | ||||||||||||||||||||
| - ".git" | ||||||||||||||||||||
| - ".git/*" | ||||||||||||||||||||
| - "*.min.js" | ||||||||||||||||||||
| - "*.bundle.js" | ||||||||||||||||||||
| - "dist/*" | ||||||||||||||||||||
| - "build/*" | ||||||||||||||||||||
| - "*.lock" | ||||||||||||||||||||
| # OmniLore workspace size control (avoid indexing generated/runtime trees) | ||||||||||||||||||||
| - ".backup-*" | ||||||||||||||||||||
| - ".backup-*/*" | ||||||||||||||||||||
| - ".omnilore" | ||||||||||||||||||||
| - ".omnilore/*" | ||||||||||||||||||||
| - ".omnilore_persist" | ||||||||||||||||||||
| - ".omnilore_persist/*" | ||||||||||||||||||||
| - ".venv" | ||||||||||||||||||||
| - ".venv/*" | ||||||||||||||||||||
| - ".venv-*" | ||||||||||||||||||||
| - ".venv-*/*" | ||||||||||||||||||||
| - "venv*" | ||||||||||||||||||||
| - "venv*/*" | ||||||||||||||||||||
| - "output" | ||||||||||||||||||||
| - "output/*" | ||||||||||||||||||||
| - "out" | ||||||||||||||||||||
| - "out/*" | ||||||||||||||||||||
| - "reports" | ||||||||||||||||||||
| - "reports/*" | ||||||||||||||||||||
| - "docs" | ||||||||||||||||||||
| - "docs/*" | ||||||||||||||||||||
| - "external" | ||||||||||||||||||||
| - "external/*" | ||||||||||||||||||||
| - "node_modules/*" | ||||||||||||||||||||
| - ".mypy_cache" | ||||||||||||||||||||
| - ".mypy_cache/*" | ||||||||||||||||||||
| - ".pytest_cache" | ||||||||||||||||||||
| - ".pytest_cache/*" | ||||||||||||||||||||
| - ".hypothesis" | ||||||||||||||||||||
| - ".hypothesis/*" | ||||||||||||||||||||
| - "htmlcov" | ||||||||||||||||||||
| - "htmlcov/*" | ||||||||||||||||||||
| - "logs" | ||||||||||||||||||||
| - "logs/*" | ||||||||||||||||||||
| - "artifacts" | ||||||||||||||||||||
| - "artifacts/*" | ||||||||||||||||||||
| - "archives" | ||||||||||||||||||||
| - "archives/*" | ||||||||||||||||||||
| - "data" | ||||||||||||||||||||
| - "data/*" | ||||||||||||||||||||
| - "chroma" | ||||||||||||||||||||
| - "chroma/*" | ||||||||||||||||||||
| supported_extensions: | ||||||||||||||||||||
| - .py | ||||||||||||||||||||
| - .js | ||||||||||||||||||||
|
|
@@ -38,14 +81,7 @@ repository: | |||||||||||||||||||
| - .kt | ||||||||||||||||||||
| - .pyx | ||||||||||||||||||||
| - .toml | ||||||||||||||||||||
| - .md | ||||||||||||||||||||
| - .txt | ||||||||||||||||||||
| - .yaml | ||||||||||||||||||||
|
||||||||||||||||||||
| - .yaml | |
| - .yaml | |
| - .md | |
| - .txt | |
| - .rst | |
| - .json | |
| - .html | |
| - .css | |
| - .xml |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -195,14 +195,26 @@ def scan_files(self) -> List[Dict[str, Any]]: | |||||||||||||
| max_file_size_bytes = self.max_file_size_mb * 1024 * 1024 | ||||||||||||||
|
|
||||||||||||||
| for root, dirs, filenames in os.walk(self.repo_path): | ||||||||||||||
| # Filter out ignored directories | ||||||||||||||
| dirs[:] = [d for d in dirs if not should_ignore_path( | ||||||||||||||
| os.path.join(root, d), self.ignore_patterns | ||||||||||||||
| )] | ||||||||||||||
| # Filter ignored directories using paths relative to repo root. | ||||||||||||||
| # Matching absolute paths can miss gitwildmatch patterns such as | ||||||||||||||
| # "output/" or ".venv/". | ||||||||||||||
| filtered_dirs = [] | ||||||||||||||
| for d in dirs: | ||||||||||||||
| abs_dir_path = os.path.join(root, d) | ||||||||||||||
| rel_dir_path = normalize_path( | ||||||||||||||
| os.path.relpath(abs_dir_path, self.repo_path) | ||||||||||||||
| ) | ||||||||||||||
| rel_dir_with_trailing = f"{rel_dir_path}/" | ||||||||||||||
| if should_ignore_path(rel_dir_path, self.ignore_patterns) or should_ignore_path( | ||||||||||||||
| rel_dir_with_trailing, self.ignore_patterns | ||||||||||||||
| ): | ||||||||||||||
|
Comment on lines
+208
to
+210
|
||||||||||||||
| if should_ignore_path(rel_dir_path, self.ignore_patterns) or should_ignore_path( | |
| rel_dir_with_trailing, self.ignore_patterns | |
| ): | |
| # Use the trailing-slash form to correctly match directory patterns | |
| # like "output/" while avoiding redundant should_ignore_path calls. | |
| if should_ignore_path(rel_dir_with_trailing, self.ignore_patterns): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ignore pattern "docs" (line 42) will match any directory or file named "docs" anywhere in the repository tree, which may be overly broad. This could unintentionally skip important documentation directories in subdirectories. Consider using "docs/*" or "/docs" (with a leading slash for root-level only) if you only want to ignore a specific docs directory. The same applies to other broad patterns like "data", "logs", "external", etc.