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

PMD is executed for all file types regardless of active rules #88

Closed
adangel opened this issue Feb 7, 2019 · 1 comment
Closed

PMD is executed for all file types regardless of active rules #88

adangel opened this issue Feb 7, 2019 · 1 comment
Labels
Milestone

Comments

@adangel
Copy link
Member

adangel commented Feb 7, 2019

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

@adangel adangel added the bug label Feb 7, 2019
@adangel
Copy link
Member Author

adangel commented Mar 2, 2019

See #91

adangel added a commit to adangel/pmd-eclipse-plugin that referenced this issue Mar 3, 2019
@adangel adangel added this to the 4.1.0 milestone Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant