PMD-Intellij icon indicating copy to clipboard operation
PMD-Intellij copied to clipboard

Settings in misc.xml polluted with settings from random other projects

Open zman0900 opened this issue 1 year ago • 1 comments

Using PMD plugin 1.8.27 with IntelliJ 2023.1.2 on Mac. This behavior started either with this version of PMD plugin, or maybe the previous 1.8.26 version.

PMD plugin setting are often updating to include the custom ruleset files from what seems to be random other projects. The other projects are not necessarily all open at the time when this happens. In .idea/misc.xml, I will see the expected line like:

<option value="$PROJECT_DIR$/path/to/pmd.xml" />

But then randomly several other lines will appear like:

<option value="$PROJECT_DIR$/../other-project/path/to/pmd.xml" />
<option value="$PROJECT_DIR$/../other-project2/path/to/pmd.xml" />
<option value="$PROJECT_DIR$/../other-project3/path/to/pmd.xml" />

Every time I remove those extra settings, they come back minutes later.

This is annoying for multiple reasons:

  • The default .gitignore file created by new IntelliJ project doesn't exclude misc.xml, so seems to suggest that sharing it is expected.
  • The "custom rules" PMD menu often list multiple rulesets that aren't relevant to current project, and it can be impossible to tell which is which when multiple of them do not include a "name" attribute on their ruleset elements.

I don't have a good way to verify this, but I suspect this may have started with the fix for #105 - 8d27a0b8c16e8e731f70889fad5f9f7197371d2a

zman0900 avatar Jun 09 '23 14:06 zman0900

This is very annoying. I use intellij for lots of projects, each one having its own definitions. Every time I want to start a PMD run manually, I have to select the configuration of the current project manually. Please stop just adding just every found configuration to every other configuration - this logic has no benefit and is probably a bug where pmd plugins share their state so they get mixed up when opening another project?

mkeller-ergon avatar Feb 29 '24 09:02 mkeller-ergon