Skip to content

Make PMD configuration scope global level in addition to project level #197

Description

@jborgers

As a IntelliJ user, I would like to configure custom rules, enable skip test sources, target JDK, statistics URL, Threads and rules annotated in Editor for IntelliJ, for all projects, instead of for each project separately, so that I don't have to do this again for each project.
Right now there is a complex and flaky merging mechanism between projects to merge custom rules, and only that. It should be properly solved.

Activity

  1. adangel commented on Nov 19, 2024

    @adangel
    Contributor

    I'm not sure, if this "global sharing between projects feature" is still needed, given that #182 / #100 is done now: Sharing configuration between project members of the same project works now by committing the file .idea/PMDPlugin.xml.

    The use case for sharing configuration between different projects sounds dubious to me... Different projects have different needs and most likely different rulesets...

    Not having such a feature makes the plugin so much simpler...

  2. adangel commented on Nov 19, 2024

    @adangel
    Contributor

    Ok, so IntelliJ also provides settings on the application scope natively

    -> https://www.jetbrains.com/help/idea/configuring-project-and-ide-settings.html
    -> https://plugins.jetbrains.com/docs/intellij/settings-guide.html#declaring-application-settings

    And these application settings apply globally to all projects.
    I think, basically what I'm trying to say is: try not to repeat the mistake that was made in the pmd-eclipse-plugin, that the configuration is a mess and global/project specific settings are mixed.

    Project scope level settings should override application scope level settings - but never the other way round. That means, as soon as you configure project specific target JDK, then the target JDK at application level is not used anymore.

  3. jborgers commented on Nov 19, 2024

    @jborgers
    CollaboratorAuthor

    Right, so it is a matter of choosing the 'right' level. And this may differ among users.
    When I add a custom rule set and I enable 'skip test sources' and I work on one project, then I load another project, I expect the custom rules set to still be available and test sources still to be skipped. In my view this is configuration on global level. And I know only of others who expect the same, and they are surprised that configuration has changed for the other project (no custom rules, all defaults.)

    But there may be other use cases. Maybe custom rules for frameworks used only in one project, or between different languages (currently only Java is supported.)

  4. jborgers commented on Nov 19, 2024

    @jborgers
    CollaboratorAuthor

    Good to have the links. It might be an option to define globally and override on project level if needed. And indeed not make it into a mess.

  5. jborgers commented on Nov 20, 2024

    @jborgers
    CollaboratorAuthor

    Related:
    #144 Configuring PMD settings by New Projects Setup results in NullPointerExceptions and
    #74 [RFE] Custom rulesets with relative path
    #63 Ability to select PMD version

  6. changed the title [-]Make PMD configuration scope application level instead of project level[/-] [+]Make PMD configuration scope global level instead of (or in addition to) project level[/+] on Nov 20, 2024
  7. changed the title [-]Make PMD configuration scope global level instead of (or in addition to) project level[/-] [+]Make PMD configuration scope global level in addition to project level[/+] on Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions