Skip to content

Conversation

@wrick17
Copy link
Contributor

@wrick17 wrick17 commented Jun 17, 2025

Summary

Needed biome to report in checkstyle format so that we can use it in tools like Jenkins Warning Plugin. Plus it's a pretty popular reporting format.

Other people seem to be interested too #2287.

Test Plan

I have tested it locally and it works based on the limited testing I have done.

PS

I have no knowledge of Rust, took a lot of help from LLMs and manually tested it as much as possible. 🙏🏻

@github-actions github-actions bot added the A-CLI Area: CLI label Jun 17, 2025
@wrick17 wrick17 changed the title feat (reporter): add checkstyle feat(reporter): add checkstyle Jun 17, 2025
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @wrick17 for your contribution. Can you at least add some tests? Create a file this one

https://github.com/biomejs/biome/blob/main/crates/biome_cli/tests/cases/reporter_junit.rs

Provide the correct information in the CLI arguments, and commit the snapshots. This will allow us to see the format, and help you with further reviews.

Plus, the code doesn't compile. While, I appreciate the use of LLMs, we should at least provide a code that compiles.

If you can't go further than that, I would appreciate if you can provide a simple explanation of the checkstyle format, so some else can takeover

@arendjr arendjr added this to the Biome 2.1 milestone Jun 23, 2025
@ematipico ematipico removed this from the Biome 2.1 milestone Jun 24, 2025
@ematipico
Copy link
Member

@wrick17 any news?

@wrick17
Copy link
Contributor Author

wrick17 commented Jul 18, 2025

@ematipico Sorry I hadn't noticed the comment. I'll try to provide all the information as soon as possible.

@ematipico ematipico changed the base branch from main to next October 6, 2025 07:09
@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2025

🦋 Changeset detected

Latest commit: e4251b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/cli-win32-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/wasm-web Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/backend-jsonrpc Patch
@biomejs/js-api Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Walkthrough

Adds a Checkstyle reporter to the Biome CLI. CLI parsing/display are extended with a new CliReporter::Checkstyle variant and the reporter argument accepts checkstyle. Execution is wired to a new ReportMode::Checkstyle (mapped from CliReporter) and dispatches to a new CheckstyleReporter. A new crates/biome_cli/src/reporter/checkstyle.rs module implements CheckstyleReporter and CheckstyleReporterVisitor to emit diagnostics as Checkstyle XML. The reporter module is exported, and tests under crates/biome_cli/tests/cases/reporter_checkstyle.rs cover multiple CLI commands. A changeset documents the feature.

Suggested labels

A-Tooling

Suggested reviewers

  • dyc3

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title uses conventional commit style and clearly indicates that the PR adds a Checkstyle reporter in the ‘reporter’ scope. It directly reflects the implementation of Checkstyle output support in the CLI. It is concise and specific, avoiding irrelevant details.
Description Check ✅ Passed The description outlines the motivation for adding Checkstyle format support, refers to related community discussion, and notes the local testing performed. It directly pertains to the changeset by describing the feature, usage context, and test plan. It therefore meets the lenient criteria for the description check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a21fbe and e4251b8.

📒 Files selected for processing (1)
  • crates/biome_cli/src/reporter/checkstyle.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_cli/src/reporter/checkstyle.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: End-to-end tests
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: autofix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 837f3f3 and 04338e2.

⛔ Files ignored due to path filters (10)
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_format_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_lint_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_check/check_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_ci/ci_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_format/format_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_lint/lint_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_migrate/migrate_help.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_rage/rage_help.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (7)
  • .changeset/light-women-live.md (1 hunks)
  • crates/biome_cli/src/cli_options.rs (4 hunks)
  • crates/biome_cli/src/execute/mod.rs (4 hunks)
  • crates/biome_cli/src/reporter/checkstyle.rs (1 hunks)
  • crates/biome_cli/src/reporter/mod.rs (1 hunks)
  • crates/biome_cli/tests/cases/mod.rs (1 hunks)
  • crates/biome_cli/tests/cases/reporter_checkstyle.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/**/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets using the just new-changeset command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like “Fixed #1234
Prefer past tense for what was done and present tense for current behavior in changesets

Files:

  • .changeset/light-women-live.md
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_cli/src/execute/mod.rs
  • crates/biome_cli/src/cli_options.rs
  • crates/biome_cli/src/reporter/mod.rs
  • crates/biome_cli/tests/cases/reporter_checkstyle.rs
  • crates/biome_cli/tests/cases/mod.rs
  • crates/biome_cli/src/reporter/checkstyle.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_cli/src/execute/mod.rs
  • crates/biome_cli/src/cli_options.rs
  • crates/biome_cli/src/reporter/mod.rs
  • crates/biome_cli/tests/cases/reporter_checkstyle.rs
  • crates/biome_cli/tests/cases/mod.rs
  • crates/biome_cli/src/reporter/checkstyle.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_cli/src/execute/mod.rs
  • crates/biome_cli/src/cli_options.rs
  • crates/biome_cli/src/reporter/mod.rs
  • crates/biome_cli/tests/cases/reporter_checkstyle.rs
  • crates/biome_cli/tests/cases/mod.rs
  • crates/biome_cli/src/reporter/checkstyle.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_cli/tests/cases/reporter_checkstyle.rs
  • crates/biome_cli/tests/cases/mod.rs
🧬 Code graph analysis (3)
crates/biome_cli/src/execute/mod.rs (1)
crates/biome_cli/src/reporter/checkstyle.rs (1)
  • new (35-37)
crates/biome_cli/tests/cases/reporter_checkstyle.rs (4)
crates/biome_cli/tests/main.rs (1)
  • run_cli (332-347)
crates/biome_cli/tests/snap_test.rs (1)
  • assert_cli_snapshot (407-409)
crates/biome_cli/src/execute/mod.rs (4)
  • new (280-286)
  • from (77-79)
  • from (89-91)
  • from (263-276)
crates/biome_cli/src/reporter/checkstyle.rs (1)
  • new (35-37)
crates/biome_cli/src/reporter/checkstyle.rs (2)
crates/biome_cli/src/reporter/mod.rs (3)
  • write (49-49)
  • report_summary (55-60)
  • report_diagnostics (72-78)
crates/biome_diagnostics/src/location.rs (1)
  • source_code (216-219)

@ematipico
Copy link
Member

@wrick17 I did the work and updated the PR. Please check the tests

@ematipico ematipico requested review from a team and ematipico October 6, 2025 09:22
@ematipico
Copy link
Member

Docs biomejs/website#3194

@ematipico ematipico merged commit 296627d into biomejs:next Oct 7, 2025
10 of 12 checks passed
@github-actions github-actions bot mentioned this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants