Skip to content

Surface Detekt stderr output for detekt_test targets#212

Open
ryanulep wants to merge 2 commits into
buildfoundation:masterfrom
ryanulep:test_output
Open

Surface Detekt stderr output for detekt_test targets#212
ryanulep wants to merge 2 commits into
buildfoundation:masterfrom
ryanulep:test_output

Conversation

@ryanulep

@ryanulep ryanulep commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Currently, when Detekt runs as a test target, its stderr output is silently discarded. This PR captures stderr output to a dedicated file ({name}_stderr.txt) and displays it in the Bazel runner script, consistent with how build targets already surface output.

Changes:

  • Add --stderr-output argument to pass a file path for capturing stderr
  • Write result.output() (stderr) to that file when running as a test target
  • Update the Bazel shell script to print the stderr file contents instead of the text report
  • Exclude --stderr-output from args passed through to Detekt

Note: We should look into providing a more succinct output similar to Error Prone (or at least the Detekt CLI) output.

@ryanulep ryanulep changed the title Test output Surface Detekt stderr output for detekt_test targets Mar 16, 2026
@ryanulep ryanulep force-pushed the test_output branch 4 times, most recently from b6ade69 to 43e95f7 Compare March 18, 2026 14:16
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