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

Make PMD configuration scope global level instead of (or in addition to) project level #197

Open
jborgers opened this issue Nov 19, 2024 · 5 comments

Comments

@jborgers
Copy link
Collaborator

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.

@jborgers jborgers assigned jborgers and unassigned jborgers Nov 19, 2024
@adangel
Copy link
Contributor

adangel commented Nov 19, 2024

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...

@adangel
Copy link
Contributor

adangel commented Nov 19, 2024

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.

@jborgers
Copy link
Collaborator Author

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.)

@jborgers
Copy link
Collaborator Author

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.

@jborgers
Copy link
Collaborator Author

jborgers commented Nov 20, 2024

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

@jborgers jborgers 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 Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants