Skip to content
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

[core] Add a filter possibility to FileCollector #4956

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

adangel
Copy link
Member

@adangel adangel commented Apr 12, 2024

Describe the PR

This adds a new API method in FileCollector in order to filter files before they are added.
Needed to fix #4942. The logic is the same as in PMD 6, meaning: if the filename (not the path) is the same and the file size, then the file is considered a duplicate.

We could do a checksum comparison or something like that, but this would then a behavioral change or a new feature.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel added the a:bug PMD crashes or fails to analyse a file. label Apr 12, 2024
@adangel adangel added this to the 7.1.0 milestone Apr 12, 2024
@pmd-test
Copy link

pmd-test commented Apr 12, 2024

1 Message
📖 Compared to master:
This changeset changes 0 violations,
introduces 141 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact
Compared to master:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.
Download full report as build artifact

Generated by 🚫 Danger

@jsotuyod jsotuyod merged commit c082f33 into pmd:master Apr 18, 2024
3 checks passed
@adangel adangel deleted the issue-4942-cpd-skip-duplicates branch April 18, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug PMD crashes or fails to analyse a file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] CPD: --skip-duplicate-files has no effect (7.0.0 regression)
4 participants