Skip to content

feat(oxlint): Add Bitbucket Code Insights output formatter#20113

Open
ild0tt0re wants to merge 1 commit intooxc-project:mainfrom
ild0tt0re:feat/bitbucket-formatter
Open

feat(oxlint): Add Bitbucket Code Insights output formatter#20113
ild0tt0re wants to merge 1 commit intooxc-project:mainfrom
ild0tt0re:feat/bitbucket-formatter

Conversation

@ild0tt0re
Copy link
Contributor

@ild0tt0re ild0tt0re commented Mar 8, 2026

Summary

Adds a new Bitbucket output formatter for oxlint that emits diagnostics as Bitbucket Code Insights annotations (bulk annotations JSON) so CI can upload reports to Bitbucket.

Why

Enable Bitbucket Code Insights integration by producing the exact annotation payload expected by Bitbucket reports endpoints. This lets CI workflows surface linter issues directly in Bitbucket's UI.

What changed

  • Added: bitbucket.rs — implements BitbucketOutputFormatter, BitbucketReporter, and serialization types.
  • Mapping: Maps Severity → Bitbucket annotation_type/severity (ErrorBUG/HIGH, WarningCODE_SMELL/MEDIUM, AdviceCODE_SMELL/LOW).
  • Repo paths: Detects git repo root and prepends repo-relative prefix (handles Windows path normalization).
  • Deterministic IDs: Generates stable external_id per diagnostic using a deterministic hash.
  • Tests: Unit tests covering serialization, path prefixing, severity mappings, and external_id determinism.

Compatibility / Migration

Non-breaking — new formatter only; existing formatters unaffected. To use, select the bitbucket formatter when running oxlint in CI and POST the resulting JSON to Bitbucket Code Insights annotations endpoint.

@ild0tt0re ild0tt0re requested a review from camc314 as a code owner March 8, 2026 14:52
@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-enhancement Category - New feature or request labels Mar 8, 2026
@ild0tt0re ild0tt0re force-pushed the feat/bitbucket-formatter branch from 6c8c8bb to de22c78 Compare March 8, 2026 14:57
@ild0tt0re ild0tt0re force-pushed the feat/bitbucket-formatter branch from de22c78 to 0f50788 Compare March 8, 2026 17:03
@camc314
Copy link
Contributor

camc314 commented Mar 8, 2026

@ild0tt0re can you include an example of what this looks like in bitbucket?

@camc314 camc314 self-assigned this Mar 8, 2026
@nrayburn-tech
Copy link
Collaborator

There’s an example screenshot about halfway down this page under the “Hiding annotations from the diff view” section.
https://confluence.atlassian.com/bitbucketserver100/code-insights-1680278535.html

It’s the part in the code diff showing as “low” and as a “WCAG” issue.

It’s a similar UI concept to the GitHub feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants