Skip to content

flush 忘れを修正#16

Merged
TwoSquirrels merged 2 commits into
mainfrom
fix-flush-marker-before-include
Jun 6, 2026
Merged

flush 忘れを修正#16
TwoSquirrels merged 2 commits into
mainfrom
fix-flush-marker-before-include

Conversation

@TwoSquirrels

@TwoSquirrels TwoSquirrels commented Jun 6, 2026

Copy link
Copy Markdown
Owner

fix #15

Summary by CodeRabbit

  • Chores

    • Version updated to 1.0.1
  • Bug Fixes

    • Improved source location tracking for include directives

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f88aac6e-a2de-4010-9605-0feebaab01fe

📥 Commits

Reviewing files that changed from the base of the PR and between 209ba83 and 423abbb.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • src/bundle/rewrite.rs

📝 Walkthrough

Walkthrough

The PR bumps the crate version to 1.0.1 and refactors the rewrite function to consistently flush pending #line directives immediately before emitting restored dummy #include lines, ensuring correct source location mapping and simplifying the control flow logic.

Changes

Marker Flushing Fix

Layer / File(s) Summary
Version release to 1.0.1
Cargo.toml
Package version metadata updated from 1.0.0 to 1.0.1.
Marker flushing refactoring and test
src/bundle/rewrite.rs
Documentation updated to specify that pending real #line markers are emitted before restored dummy #include lines. Core rewrite loop refactored to uniformly flush pending markers and emit either the restored include or original line for all surviving code lines, removing prior branching on empty output. Test case added to validate that pending markers flush before mid-stream restored includes, preserving correct line number alignment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A marker's place, now crystal clear,
Flushed just before the include appears,
No special cases left to confuse,
One clean path—no branches to choose.
The version bumps, the tests now pass,
Logic fixed with elegant grace! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'flush 忘れを修正' directly addresses the main objective of fixing a flush-related issue in the code, as evidenced by the refactoring in src/bundle/rewrite.rs.
Linked Issues check ✅ Passed The PR successfully addresses issue #15 by fixing the insufficient flush handling in src/bundle/rewrite.rs to correct #line directive positioning.
Out of Scope Changes check ✅ Passed All changes are in scope: src/bundle/rewrite.rs fixes the flush issue (#15), and Cargo.toml version bump (1.0.0→1.0.1) documents the release with this fix.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ 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 fix-flush-marker-before-include

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.

Copilot AI 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.

Pull request overview

This PR fixes incorrect #line placement in the bundling rewrite pass by ensuring pending real source markers are flushed not only before normal code lines, but also immediately before restored #include lines (converted from #pragma RISUNDLE_DUMMY ...). This aligns restored includes with their original source locations, addressing Issue #15.

Changes:

  • Always flush a pending real linemarker before emitting any surviving output line (including restored #include).
  • Update module-level documentation to reflect the corrected marker emission behavior.
  • Add a regression test for flushing pending markers before a mid-stream restored include; bump crate version to 1.0.1.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/bundle/rewrite.rs Flushes pending markers before restored includes and adds a regression test to prevent #line mis-association.
Cargo.toml Bumps crate version to 1.0.1 for the fix release.
Cargo.lock Updates lockfile to reflect the new crate version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TwoSquirrels TwoSquirrels merged commit f4af8f9 into main Jun 6, 2026
1 check passed
@TwoSquirrels TwoSquirrels deleted the fix-flush-marker-before-include branch June 9, 2026 13:28
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.

#line の位置がおかしい!

2 participants