Skip to content

Fix formatting in diagnostic printer#41

Merged
warunalakshitha merged 2 commits intoballerina-platform:mainfrom
snelusha:fix/diagnostics-colors
May 5, 2026
Merged

Fix formatting in diagnostic printer#41
warunalakshitha merged 2 commits intoballerina-platform:mainfrom
snelusha:fix/diagnostics-colors

Conversation

@snelusha
Copy link
Copy Markdown
Contributor

@snelusha snelusha commented May 4, 2026

Purpose

$subject

Summary

This pull request improves the formatting of diagnostic output in the WASM diagnostic printer. The change refines how source lines are rendered by adjusting the line-number separator formatting to include explicit reset codes and proper spacing around the separator marker. This enhancement improves the visual presentation and clarity of diagnostic messages displayed to users.

Files Changed:

  • packages/wasm/diagnostic_printer.go: Formatting improvements to source snippet rendering

Impact: Minimal, low-effort change that enhances diagnostic output presentation without affecting diagnostic selection or highlighting logic.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd2e358e-9be1-4606-9e1c-05d556dd40f3

📥 Commits

Reviewing files that changed from the base of the PR and between 070fa4b and 09ae638.

📒 Files selected for processing (1)
  • packages/wasm/diagnostic_printer.go

📝 Walkthrough

Walkthrough

The printSourceSnippet function in the diagnostic printer was updated to adjust terminal output formatting. The line-number and separator rendering now explicitly includes color reset codes and adjusted spacing around the pipe separator character.

Changes

Diagnostic Output Formatting

Layer / File(s) Summary
Display Formatting
packages/wasm/diagnostic_printer.go
Line 169 updated to include s.cyan before the separator, explicit s.reset after it, and revised spacing around | for improved terminal output rendering.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • warunalakshitha

Poem

🐰 A little tweak, so neat and small,
Colors reset, spaces stand tall,
The | now breathes with room to spare,
Terminal output, freshly fair! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and off-topic. It only contains a placeholder '$subject' in the Purpose section and is missing all other required sections from the template. Complete the PR description by filling in all required template sections: Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: a formatting fix in the diagnostic printer component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

@snelusha snelusha requested a review from warunalakshitha May 4, 2026 08:27
Copy link
Copy Markdown
Contributor

@warunalakshitha warunalakshitha left a comment

Choose a reason for hiding this comment

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

LGTM

@warunalakshitha warunalakshitha merged commit 43db468 into ballerina-platform:main May 5, 2026
3 checks passed
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.

2 participants