T-020: Enhance scan — depth, ignore, and patterns #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the enhanced scan functionality as described in issue #110, adding hierarchical scanning capabilities with depth control, pattern-based filtering, and gitignore integration.
🚀 New Features
Hierarchical Scanning
Pattern-Based Filtering
Gitignore Integration
File Sampling
🔧 API Changes
Enhanced `collect_evidence()` Function
```python
collect_evidence(
root: Path,
depth: Optional[int] = None, # 0=root only, None=unlimited
ignore_patterns: Optional[list[str]] = None, # Glob patterns to ignore
respect_gitignore: bool = False, # Honor .gitignore rules
show_files_sample: Optional[int] = None # Number of sample files
)
```
JSON Schema Updates
🧪 Testing
Comprehensive Test Coverage
Test Scenarios Covered
📚 Documentation
Updated Documentation
Usage Examples
```bash
Depth control
autorepro scan --depth 0 # Root only
autorepro scan --depth 2 # Up to 2 levels deep
Pattern filtering
autorepro scan --ignore 'node_modules/' --ignore 'dist/'
Gitignore integration
autorepro scan --respect-gitignore
File sampling
autorepro scan --json --show 3 # Up to 3 sample files per language
```
✅ Acceptance Criteria
All acceptance criteria from issue #110 are met:
🔄 Manual Test Results
All manual tests from the issue pass:
🚦 Breaking Changes
None - This is a fully backward-compatible enhancement:
🔗 Related
Closes #110
Ready for review - All tests passing, documentation updated, and acceptance criteria met.