Skip to content

fix: multiline prefix alignment#103

Merged
chenjiahan merged 2 commits into
mainfrom
chenjiahan/fix-multiline-prefix-alignment
Jul 15, 2026
Merged

fix: multiline prefix alignment#103
chenjiahan merged 2 commits into
mainfrom
chenjiahan/fix-multiline-prefix-alignment

Conversation

@chenjiahan

@chenjiahan chenjiahan commented Jul 15, 2026

Copy link
Copy Markdown
Member

This PR fixes continuation-line alignment for label-less logger methods with a prefix by deriving both rendering and indentation from the same header.

It also pins pnpm to 11.11.0 because the 11.13.0 standalone platform package omits its executable and breaks local installs. This follows up on #94 and adds regression coverage for logger.log() with alignMultiline enabled.

@chenjiahan chenjiahan changed the title fix: restore pnpm installs and multiline prefix alignment fix: multiline prefix alignment Jul 15, 2026
@chenjiahan
chenjiahan marked this pull request as ready for review July 15, 2026 06:33
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Updated logger output construction so labels and prefixes share one header for console output and multiline alignment. Added a test covering prefix-based multiline alignment. Changed the declared pnpm version in package.json.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main code change: fixing multiline prefix alignment in the logger.
Description check ✅ Passed The description is directly related to the logger fix and pnpm pinning in this pull request.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chenjiahan/fix-multiline-prefix-alignment

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/logger.test.ts`:
- Around line 307-321: Update the “should align multi-line log messages to
prefix column” test to stop overwriting global console.log; create a locally
mocked console object with a strict-safe type and pass it through createLogger’s
optional console dependency, then assert against that injected mock’s calls
while preserving the existing alignment expectation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ee853896-315a-4d72-92fd-1a8c401f0518

📥 Commits

Reviewing files that changed from the base of the PR and between c049767 and a53bec7.

📒 Files selected for processing (3)
  • package.json
  • src/createLogger.ts
  • tests/logger.test.ts

Comment thread tests/logger.test.ts
@chenjiahan
chenjiahan merged commit 8832661 into main Jul 15, 2026
4 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/fix-multiline-prefix-alignment branch July 15, 2026 06:41
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