-
Notifications
You must be signed in to change notification settings - Fork 7.6k
1.x: Add PMD #4064
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
1.x: Add PMD #4064
Conversation
} | ||
} | ||
|
||
build.dependsOn 'pmd' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I did the change through Sublime. I have it activated on my AS + IntelliJ. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this task dependency for now, it fails the build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please remove this for now. We'll run PMD in our IDEs and post fixes for it. Once the master builds without errors, this can be re-enabled.
<rule ref="rulesets/java/coupling.xml"/> | ||
<rule ref="rulesets/java/design.xml"/> | ||
<rule ref="rulesets/java/empty.xml"/> | ||
<rule ref="rulesets/java/naming.xml"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's disable it for now, mostly it complains about short variable names like s
/etc
I'm not against adding these checks, however, I see these problems:
I don't want the rule violations to block merging the PRs but rather consider them as warnings, just like the coverage tests |
+1 to not fail the build for now, @vanniktech let's try to apply only useful warnings and remove all false-positives/non-needed. |
@@ -0,0 +1,31 @@ | |||
<?xml version="1.0"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put this solo file into the root directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later there would be also one for Checkstyle & Findbugs so I thought a common folder would be adequate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could live with these in the root:
/pmd.xml
/checkstyle.xml
/findbugs.xml
I'd create a separate dir only if you have like many extra files with odd filenames with underscores or something.
Rules to disable:
With these disabled, I have around 500 violations that can be managed. |
@akarnokd should I manually disable them or use the configuration from the file you uploaded? |
I guess you don't want to walk through my list when you could just use the config file. |
True. I updated it. 👍 |
This PMD doesn't like the rule:
|
Now it seems like Travis kills our gradle :( |
Error 137 is typically due to out-of-memory situation |
Did some experiments in my own: #4068. Should print some of the violations into the build log. |
Yeah also yours seems to be running on Travis. If you want you can close this one in favor of #4068 |
Sure, thanks for your experiments! |
As discussed in #3164
Right now there are 10243 PMD rule violations.
For now I activated all checks though it is recommend to disable some of them.