Skip to content

fix(java): use PMD -f text instead of unparseable textcolor - #710

Open
scr963 wants to merge 1 commit into
peteromallet:mainfrom
scr963:fix/pmd-textcolor-unparsed
Open

fix(java): use PMD -f text instead of unparseable textcolor#710
scr963 wants to merge 1 commit into
peteromallet:mainfrom
scr963:fix/pmd-textcolor-unparsed

Conversation

@scr963

@scr963 scr963 commented Aug 15, 2026

Copy link
Copy Markdown

Problem

desloppify scan on a Java project reports pmd tooling unavailable (tool_failed_unparsed_output) even when PMD 7 is installed and on PATH. The java language module runs pmd check ... -f textcolor but declares fmt: "gnu" for the detector — textcolor emits a multi-line human report that the gnu parser cannot read, so every PMD scan fails as "unparsed output" and the pmd_violation detector silently reports nothing.

Command used: desloppify scan --path . in a Java/Gradle project with PMD 7.26 installed via Homebrew.

Fix

Change the format flag from textcolor to text in PMD_COMMAND (desloppify/languages/java/init.py). pmd check -f text emits one-line file:line:\trule:\tmessage records that the gnu parser consumes correctly.

Verified against a scratch Java project: with the fix, the pmd tool step completes and UnusedPrivateField/ControlStatementBraces violations are detected; no coverage-reduced warning. Full test suite: 5660 passed; the 3 failing tests in test_bash_unused_imports.py fail identically on main (pre-existing, unrelated).

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

Successfully merging this pull request may close these issues.

1 participant