pmd/pmd-eclipse-plugin

PMD is executed for all file types regardless of active rules

adangel opened this issue · 1 comments

Description: Given a ruleset, that only contains rules for Java, the pmd-eclipse-plugin executes PMD not only on Java files, but on all resources in the project.
This not only is a performance problem, but this leads also to unrelated errors (e.g. a JavaScript file that cannot be parsed).

Expected Result:
The plugin should detect the applicable file types based on the selected rules. E.g. only *.java rules should be executed.
The command line interface of PMD is doing this already.

Workaround:
Using a file-filter, you can exclude problematic files:

<exclude-pattern>.*\.js</exclude-pattern>

Since the includes are overriding the excludes, you can exclude everything except for java files:

   <exclude-pattern>.*</exclude-pattern>
   <include-pattern>.*\.java</include-pattern>

Documentation: https://pmd.github.io/pmd-6.11.0/pmd_userdocs_making_rulesets.html#filtering-the-processed-files

This can also be configured via Window, Preferences, PMD, File Filter:
grafik

See #91