Skip to content

Add JUnit formatter - #513

Open
cosgroveb wants to merge 1 commit into
prontolabs:masterfrom
cosgroveb:junit-formatter
Open

cosgroveb wants to merge 1 commit into
prontolabs:masterfrom
cosgroveb:junit-formatter

Conversation

@cosgroveb

@cosgroveb cosgroveb commented Oct 17, 2026 •

Copy link
Copy Markdown

Some CI test views read only JUnit XML (Harness reads JUnit XML or TRX),
so checkstyle output never shows up there.

JUnit has no concept of a lint finding. The formatter copies the mapping
rubocop --format junit uses: one testcase per runner and changed file,
tests counts files, failures counts messages. This makes this a bit of
a "square-peg in a round hole" kind of thing which is similar to Rubocop's
own JUnit runner. It would be better for me to use checkstyle! But alas...

Two things:

  1. A runner can show a phantom pass for a file it never checks
    (pronto-rubocop on a .xml file). Runners filter files internally,
    and formatters can't see that filtering. RuboCop has the same gap one
    level down: rubocop --format junit a.rb lists Bundler/GemFilename
    as passing.
  2. Runners#active_runners is now public, so the formatter applies the
    same runners, skip_runners, max_warnings and exclude rules
    instead of copying them.

An optional runner hook (say Runner#inspected_patches, defaulting to
every patch) would solve the phantom-pass thing but I felt that a smaller, more
reviewable change would be best for now. I'm happy to follow up if this sounds
like a reasonable thing to change.

I didn't see an AI assistance policy and it's understandably a hot topic right
now so in the interest of openness... I did generate the code using claude
code. I reviewed it carefully through a few iterations and tried to hew as
closely to project standards. Any mistakes are my own.

Assisted-by: Claude:claude-opus-5-5
@cosgroveb
cosgroveb requested a review from a team as a code owner October 17, 2026 12:34
@cosgroveb cosgroveb changed the title add junit formatter Add JUnit formatter Oct 17, 2026
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