ChuckJonas / vscode-apex-pmd

PMD static analysis for Apex in vscode
MIT License
78 stars 84 forks source link

Custom ruleset not working after the update #169

Open anukacjay opened 1 week ago

anukacjay commented 1 week ago

Describe the bug After the updating to version 7.0.0 the I get an error when running the custom ruleset.

Apex PMD Output stderr:[ERROR] Cannot load ruleset category/vf/security.xml/VfCsrf: Cannot resolve rule/ruleset reference 'category/vf/security.xml/VfCsrf'. Make sure the resource is a valid file or URL and is on the CLASSPATH. Use --debug (or a fine log level) to see the current classpath. Failed Exit Code: 1

Apex PMD Settings

Apex File

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

adangel commented 1 week ago

The update from PMD 6 to PMD 7 is a major version change. Please check out https://docs.pmd-code.org/latest/pmd_userdocs_migrating_to_pmd7.html for the necessary changes.

According to your error message, this section is relevant for you: https://docs.pmd-code.org/latest/pmd_userdocs_migrating_to_pmd7.html#approaching-700

If you use Visualforce, then you need to change “vf” to “visualforce”, e.g. category/vf/security.xml ➡️ category/visualforce/security.xml