Pull #18529: Fix wrong test scope for PMD#18529
Conversation
|
reopen after enabler: |
PMD CI configPMD gatekeeper
|
New pmd violations:
|
|
CI job should stay as is we can do two mvn commands under ci command to run spotbugs and pmd separately |
|
i dont think so. Why having this coupled for no reason? please conaider dedication and seperation principle to see each job upfront like we for other SCA tool as well: |
yes kind of to fix now. but why having this coupling? |
|
item: Command: New pmd violations:
|
PMD gatekeeperPMD and spotbugs
yes now its your style. actually its just the test scope issue. |
PMD and spotbugsPMD and spotbugs #18470
|
item |
| <exclude name="DataClass"/> | ||
| <!-- Too many alarms on the check classes, we will never move logic out of the check, | ||
| each check is an independent logic container. --> | ||
| <exclude name="ExceptionAsFlowControl"/> |
There was a problem hiding this comment.
You might share it before.
Please share one more time violation that we suppressing I need to double check
There was a problem hiding this comment.
you also found it
[�[1;33mWARNING�[m] PMD Failure: com.puppycrawl.tools.checkstyle.
AbstractAutomaticBean:243 Rule:ExceptionAsFlowControl Priority:3
Exception thrown at line 237 is caught in this block..
lets just go. in PMD we trust.
There was a problem hiding this comment.
yes, this rule is not working well, ok to disable
There was a problem hiding this comment.
no the rule is working fine kind of, but its the way its done in java since day one.
isnt´t it? @adangel
There was a problem hiding this comment.
I don't know what you mean with "its done in java since day one"...
So, PMD claims that
But this doesn't look to be the case:
This leads to the conclusion: Either PMD is wrong or PMD is not called correctly. I suspect that latter, as figuring out the relation of types requires a correct auxclasspath, see the comment above in "validation.sh".
There was a problem hiding this comment.
I don't know what you mean with "its done in java since day one"...
Being in the industry for 15 years, i learned from day one Exception As Flow Control is bad, still it was done every since in all the codebases around.
So PMD is correctly working, yes.
There was a problem hiding this comment.
if this is so fragile then better extract the tool calls to avoid any unwanted interconnection.
actually consider the comment it feels strange that PMD and spot are connected even the commen stated it needs to run alone.
coupling is always bad software design so lets avoid in CI as well.
checkstyle/.circleci/config.yml
Line 205 in b8d7e30
|
rdy 2 merge. |
|
lets fix and pick this low hanging fruit @romani |
|
please do #18529 (comment) |
| CHECKSTYLE_DIR=$(pwd) | ||
| export MAVEN_OPTS='-Xmx2g' | ||
| ./mvnw -e --no-transfer-progress clean test-compile pmd:check spotbugs:check | ||
| ./mvnw -e --no-transfer-progress clean pmd:check spotbugs:check |
There was a problem hiding this comment.
This call of pmd and spotbugs most likely won't work correctly now: PMD and spotbugs require that the project under analysis is compiled. These tools need access to the bytecode (aka. auxclasspath). Hence there was "test-compile" added before...
Without this, these tools could produce false positive and/or negatives.
There was a problem hiding this comment.
with this the tool did not worked properly ether, so its kind of strange, as the copse was limited to test.
rewrite is able to call the compile phase itself is this something PMD can adjust as well? this is kind of error prone.
There was a problem hiding this comment.
if this is important then we should call both compile goals, which would hopefully also fix the scope issue.
There was a problem hiding this comment.
This call of pmd and spotbugs most likely won't work correctly now: PMD and spotbugs require that the project under analysis is compiled. These tools need access to the bytecode (aka. auxclasspath). Hence there was "test-compile" added before... Without this, these tools could produce false positive and/or negatives.
idk but actually adding the compile phase is in both cases wrong having tried it only the one WITHOUT is failing like expected to call PMD just like rewrite tool:goal without any prefix goal imposing unwanted coupling and config burden to user;
|
lets merge. Looking into the facts PMD is working fine, as without the change its definitely not good working not at all. |
| export MAVEN_OPTS='-Xmx2g' | ||
| ./mvnw -e --no-transfer-progress clean test-compile pmd:check spotbugs:check | ||
| ./mvnw -e --no-transfer-progress clean pmd:check | ||
| ./mvnw -e --no-transfer-progress clean spotbugs:check |
There was a problem hiding this comment.
only spot bugs need this ....
PMD and spotbugs #18470PMD #18470
romani
left a comment
There was a problem hiding this comment.
I am ok to run tools separately.
They are too advanced now and conflicting with each other or with previous tools (jacoco).
checker, pitest, error-prone already fully separate.
PMD #18470PMD
then suggest to fully split. not only in some command. |
|
No , same CI Job, two tasks in it. |

Pull #18529: Fix wrong test scope for
PMD#18470