[PR #1252] [MERGED] [codex] Fix Rust structure line counting #5002

Closed
opened 2026-10-22 04:12:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1252
Author: @Xelvanis
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @Xelvanis

Base: refactor ← Head: codex/fix-rust-structure-line-count


📝 Commits (1)

  • 1c67f9e Fix Rust structure line counting

📊 Changes

1 file changed (+10 additions, -1 deletions)

View changed files

📝 scripts/check-rust-structure.mjs (+10 -1)

📄 Description

Linked issue

None - local chore/tooling fix, no public issue.

Why this change

  • scripts/check-rust-structure.mjs counted a normal terminal newline as an extra logical line, so a Rust module with exactly the configured line limit could fail as one line over.

What changed

  • Added a focused logical line counter that ignores one terminal newline before applying configured max-line limits.
  • Preserved real over-limit failures, including intentional trailing blank logical lines and 751-line files.

Refactor impact

Primary owner:

  • Architecture check tooling: scripts/check-rust-structure.mjs

Impact areas reviewed:

  • Architecture/import-rule validation path.
  • Rust import module structure gate.

Boundary notes:

  • No product, React feature, engine, shared API, Tauri runtime, or Rust behavior changed.
  • Forbidden-pattern checks are unchanged.

Pressure points touched:

  • scripts/check-rust-structure.mjs only. No Rust import modules were edited.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Automated/local proof run before opening this draft:

  • Reproduced the bug with a scratch fixture: 750 logical lines plus a terminal newline failed as 751 before the fix.
  • Verified the fixed path: 750 LF lines plus terminal newline passes.
  • Verified CRLF handling: 750 CRLF lines plus terminal newline passes.
  • Verified no-terminal-newline handling: 750 lines without terminal newline passes.
  • Verified negative controls: 750 lines plus an intentional trailing blank logical line still fails as 751, and 751 CRLF lines still fails.
  • Ran pnpm check:architecture; dependency-cruiser passed and Rust structure check passed.
  • Ran git diff --check; no whitespace errors were reported. Git emitted only the local LF/CRLF conversion warning for the touched script.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

Docs/release notes: not needed; this is an internal architecture-check tooling fix with no user-facing app behavior change.

UI evidence

Not applicable; no UI behavior changed.

Summary by CodeRabbit

  • Chores
    • Improved the accuracy of structure validation for internal checks by refining line-counting logic.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1252 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `codex/fix-rust-structure-line-count` --- ### 📝 Commits (1) - [`1c67f9e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1c67f9e933557494c8d58120d1cc598323512570) Fix Rust structure line counting ### 📊 Changes **1 file changed** (+10 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `scripts/check-rust-structure.mjs` (+10 -1) </details> ### 📄 Description ## Linked issue None - local chore/tooling fix, no public issue. ## Why this change - `scripts/check-rust-structure.mjs` counted a normal terminal newline as an extra logical line, so a Rust module with exactly the configured line limit could fail as one line over. ## What changed - Added a focused logical line counter that ignores one terminal newline before applying configured max-line limits. - Preserved real over-limit failures, including intentional trailing blank logical lines and 751-line files. ## Refactor impact Primary owner: - Architecture check tooling: `scripts/check-rust-structure.mjs` Impact areas reviewed: - Architecture/import-rule validation path. - Rust import module structure gate. Boundary notes: - No product, React feature, engine, shared API, Tauri runtime, or Rust behavior changed. - Forbidden-pattern checks are unchanged. Pressure points touched: - `scripts/check-rust-structure.mjs` only. No Rust import modules were edited. ## Validation - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Automated/local proof run before opening this draft: - Reproduced the bug with a scratch fixture: 750 logical lines plus a terminal newline failed as 751 before the fix. - Verified the fixed path: 750 LF lines plus terminal newline passes. - Verified CRLF handling: 750 CRLF lines plus terminal newline passes. - Verified no-terminal-newline handling: 750 lines without terminal newline passes. - Verified negative controls: 750 lines plus an intentional trailing blank logical line still fails as 751, and 751 CRLF lines still fails. - Ran `pnpm check:architecture`; dependency-cruiser passed and Rust structure check passed. - Ran `git diff --check`; no whitespace errors were reported. Git emitted only the local LF/CRLF conversion warning for the touched script. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims Docs/release notes: not needed; this is an internal architecture-check tooling fix with no user-facing app behavior change. ## UI evidence Not applicable; no UI behavior changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Improved the accuracy of structure validation for internal checks by refining line-counting logic. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1252?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5002
No description provided.