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

Error activating / deactivating rules with the same name #170

Open
sfieux opened this issue Jan 12, 2023 · 0 comments
Open

Error activating / deactivating rules with the same name #170

sfieux opened this issue Jan 12, 2023 · 0 comments
Labels

Comments

@sfieux
Copy link

sfieux commented Jan 12, 2023

Hi, I think I spotted a bug when I try to activate a rule in Java and deactivate the rule with the same name in all other languages.

Tested with Eclipse 4.25.0 (2022-09) and PMD plugin 4.40.0.v20221029

Steps to reproduce:

  • Install PMD Eclipse plugin
  • Import project with Java and Javascript. In my case, the Java is the code I actually want to check, and the Javascript is automatically generated in target directory (Jacoco report in HTML/JS format), I don't want to see violations for
  • Go to Window -> Preferences -> PMD Rule Configuration
  • Activate rules manually: choose to activate AssignmentInOperand for Java and deactivate it for Ecmascript
  • Apply & close, click Yes when it asks for a full rebuild
  • The project sees violations in the Javascript that we just deactivated :'(
  • Reopen Window -> Preferences -> PMD Rule Configuration
  • The Ecmascript rule we just deactivated is now activate again :'(

I played around with Eclipse preference files, it seems that the activated rules are stored just with their names without mentioning the language and without storing the rules properties. This would break when several rules have the same name.

I worked around this bug by ignoring the target folder in the File Filters preference.

@adangel adangel changed the title Error activating / desactivating rules with the same name in eclipse Error activating / deactivating rules with the same name Feb 17, 2023
@adangel adangel added the bug label Feb 17, 2023
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

2 participants