fix: prevent duplicate files when `--files-changed-only=false` by 2bndy5 · Pull Request #164 · cpp-linter/cpp-linter · GitHub
Skip to content

fix: prevent duplicate files when --files-changed-only=false#164

Merged
2bndy5 merged 1 commit into
mainfrom
no-duplicate-found-files
Oct 3, 2025
Merged

fix: prevent duplicate files when --files-changed-only=false#164
2bndy5 merged 1 commit into
mainfrom
no-duplicate-found-files

Conversation

@2bndy5

@2bndy5 2bndy5 commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

I found that the glob pattern for some extensions hit multiple files more than once.

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.

Summary by CodeRabbit

  • New Features
    • Guaranteed deduplication of source files during analysis to avoid repeated processing and messages.
  • Performance
    • Minor efficiency improvement by eliminating duplicates before processing.
  • Behavior Change
    • File processing/output order may vary between runs due to deduplication changes; content remains the same.

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.
@2bndy5 2bndy5 added the bug Something isn't working label Oct 3, 2025
@coderabbitai

coderabbitai Bot commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Oct 3, 2025

Copy link
Copy Markdown

@2bndy5 2bndy5 merged commit 4d2df05 into main Oct 3, 2025
43 checks passed
@2bndy5 2bndy5 deleted the no-duplicate-found-files branch October 3, 2025 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant