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
Allow plug-in to leverage xml metadata rules #571
Comments
Hi @rsoesemann - thanks for notifying us about this feature. We'll try it out and update you here. |
Hi @rsoesemann . |
@jfeingold35 thanks for your response. What I don't undertstand or what I found improvable is why I need to compile custom rules into a jar before I can use them. The whole point of custom rules in the ruleset.xml is that team members can modify them, commit them and then use them without any admin of the CI process to compile something. I mean make it work like it would work with PMD on the command line. Otherwise Is this technically feasable? I believe many PMD users are currently wanting to leverage custom rules and need tool support for them. |
Hi @rsoesemann . To make your file compatible with the scanner, you could move the rule definitions into a After registering the files through |
For future readers of this thread, the criteria for standalone XML files are as follows:
Also, please be aware that, since PMD has deprecated rulesets and plans to remove them in v7, we have deprecated rulesets as well, and have long-term plans to remove support for them. Our documentation will be updated to reflect this information, but we’re also leaving it here for future reference. |
@jfeingold35 thanks for those detail. Do you have an example repo showing such a split between Custom Rules XML and the actual ruleset. Maybe I should wait for this documentation but I am just so keen on getting this to work. Maybe you can just describe how to split https://github.com/rsoesemann/unhappy-soup/blob/master/ruleset.xml and where to put the second xml. |
@rsoesemann , no problem. For the custom rules you defined in lines 26-188, we recommend the following:
For the standard Apex rules referenced in lines 8-21, we recommend the following:
At this point, you can verify that everything worked properly by running
|
@rsoesemann , we released a new version of the plugin yesterday, and it includes the aforementioned changes to the documentation. I'm going to mark this issue closed. Please feel free to open a new one if needed. |
Sorry for my ignorance but where is this updated documentation @jfeingold35? Can't find it. |
In the recent PMD Versions, there are some great additions for SF Devs that I am unsure if the CLI Scanner fully supports them.
The biggest one is Support for Custom XPath rules that do not check Apex but arbitrary XML metadata like this.
Feel free to use a clone of this repo to test it
https://github.com/rsoesemann/unhappy-soup
The text was updated successfully, but these errors were encountered: