fix: prevent duplicate files when --files-changed-only=false#164
Conversation
I found that the glob pattern for some extensions hit multiple files more than once.
```py
pathlib.Path(".").rglob("*.c")
# matches demo.c and demo.cpp
```
Worse, the duplicates were being analyzed more than once.
So, this offer a performance improvement as well.
Walkthroughlist_source_files now accumulates matching source file paths in a set instead of a list, guaranteeing uniqueness and not preserving order. The function constructs and returns FileObj instances from this set of unique paths. No exported/public declarations were altered. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)cpp_linter/common_fs/file_filter.py (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
=======================================
Coverage 98.26% 98.26%
=======================================
Files 23 23
Lines 1899 1899
=======================================
Hits 1866 1866
Misses 33 33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I found that the glob pattern for some extensions hit multiple files more than once.
Worse, the duplicates were being analyzed more than once. So, this offer a performance improvement as well.
Summary by CodeRabbit