-
Notifications
You must be signed in to change notification settings - Fork 42
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
Plugin not load ruleset and verify all rules at eclipse startup #180
Comments
Thanks for the report. Would you mind to share your workspace log file (eclipse error log) the next time this happens?. The plugin has also a logging setting, you could also configure this in the preferences and share the log file of the plugin only. |
Hummm, according to logs it looks like the problem is from the
After some tests, removing exclude-pattern remove 1 error, (what is strange because there are in the official documentation, i will looks for the others |
Ok found it. <rule ref="category/java/codestyle.xml/FieldNamingConventions">
<properties>
<property name="finalPattern" value="[A-Z][A-Z0-9_]*" />
</properties>
</rule> was the probleme because property finalPattern is misspelled and so thats make all the file crashing. But i still have no idea about the |
I have a similar error. Would be nice to receive a proper error message or warning in such cases. |
Yes, the property name is "finalFieldPattern" (https://docs.pmd-code.org/latest/pmd_rules_java_codestyle.html#fieldnamingconventions) The exclude pattern in the ruleset xml file is supposed to be a valid java regular expression. I don't think, we are explicit about the syntax of these patterns in the doc (https://docs.pmd-code.org/latest/pmd_userdocs_making_rulesets.html#filtering-the-processed-files). I know, that the eclipse plugin internally used to use ant-like pattern - so converting between the two might also contain some bugs. Looking at your pattern, I think, the following produces a syntax error: <exclude-pattern>*.min.js</exclude-pattern> It should be <exclude-pattern>.*\.min\.js</exclude-pattern> warning: I'm not sure about the escapes for ".". Remember, that a dot "." matches any character and not only a dot. Your include pattern also don't look correct, so you probably don't pick up all files you want: <include-pattern>./WEB-INF/src/*</include-pattern>
instead use
<include-pattern>/WEB-INF/src/.*</include-pattern> |
Hi,
I don't know why but sometimes the PMD don't want to read the ruleset file and try to verify all rules.
The only way that i found to fix that is switching git branch to a branch with different
.pmd
and.ruleset.xml
then come back to branch and it correcly read it again.My
ruleset.xml
My
.pmd
Eclipse version:
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components) 4.27.0
PMD Version:
7.0.0.v20230502-1028-rc2
The text was updated successfully, but these errors were encountered: