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

Custom ruleset.xml #417

Open
draskov opened this issue Nov 17, 2023 · 4 comments
Open

Custom ruleset.xml #417

draskov opened this issue Nov 17, 2023 · 4 comments
Assignees

Comments

@draskov
Copy link

draskov commented Nov 17, 2023

Hi,
I am really having a hard time finding an answer is it possible to define a custom ruleset file for the PMD plugin?

We are running the PMD plugin in Intellij and we have defined a custom file with some rules reconfigured there. Can this be applied also to the SonarCube PMD plugin?

Big thanks in advance.

@jborgers
Copy link
Owner

jborgers commented Apr 24, 2024

Yes, it can, with an extra plugin. See https://github.com/jborgers/sonar-pmd-custom

@jborgers jborgers self-assigned this Apr 24, 2024
@Zempik
Copy link

Zempik commented Jan 16, 2025

@jborgers
Good afternoon. Thank you for developing the plugin.
Currently, the repository https://github.com/jborgers/sonar-pmd-custom redirects to https://github.com/jborgers/sonar-pmd-jpinpoint.
Is it now possible to add custom rules for other languages?

@jborgers
Copy link
Owner

jborgers commented Jan 16, 2025

Hi @Zempik

You are welcome.

To support other languages, sonar-pmd plugin will have to be extended. It used to support only Java and we extended it for Kotlin. I guess that should not be too hard. What is the language?
We are open to PR's.

sonar-pmd-custom was actually only used for our custom jpinpoint-rules and that's why we made it specific. But you can make one for your own custom ruleset easily by replacing the jpinpoint-rules properties/files with your own. The readme files should help.

@Zempik
Copy link

Zempik commented Jan 17, 2025

@jborgers
Thank you for the quick response. I'm referring to the PL/SQL (Oracle) language. My goal is to use XPath 2, which supports regex. SonarQube only supports XPath 1.0 without regex. Could you please tell me if there's a way to modify the "XPath rule template" from the plugin for use with the PL/SQL language?

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

3 participants