[PR #6375] [MERGED] native_loot_kinds_stay_hookable reads loot.rs with LF line endings #6832

Closed
opened 2026-11-03 06:27:44 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6375
Author: @breachato
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/loot-hook-test-crlf


📝 Commits (3)

  • 9e09e3c native_loot_kinds_stay_hookable reads loot.rs with LF line endings
  • a8ac6c8 Merge remote-tracking branch 'upstream/main' into fix/loot-hook-test-crlf
  • 7630a2a native_breathing_stays_hookable reads breathing.rs with LF line endings

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/native_hooks.rs (+2 -2)

📄 Description

🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally.

What and why

Fixes #6372.

game::native_hooks::tests::native_loot_kinds_stay_hookable reads horizon-world/src/loot.rs with include_str! and looks for "\n}\n" to find the end of each loot hook's body. A Windows checkout with Git for Windows' default core.autocrlf=true has the file in CRLF, so the search found nothing, find(..).unwrap() panicked, and pr_ready reported a failure on every branch there (#6321, #6322, #6337 and #6348 all note it).

The test now normalises the line endings first with .replace("\r\n", "\n"), as the tests next to it in the same module already do. One line; no behaviour change, and CI (LF checkout) runs it as before.

Update: main since added native_breathing_stays_hookable, which reads breathing.rs the same way and fails the same way on Windows. The second commit normalises it too (after merging main into this branch). With both, the 21 native_hooks tests pass on this Windows checkout.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

none

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-G0M27UC, against upstream/main at 62bdd29b2, 10 min 3 s)

Check Result
Scope ✅ 1 files, +1 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (3 min 8 s)
rustfmt ✅ (16 s)
clippy ✅ (2 min 12 s)
tests: horizon-client ✅ 563 passed (4 min 19 s)
doc tests ✅ 0 passed (4 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on Windows with core.autocrlf=true: tests: horizon-client now passes in full here (it failed on native_loot_kinds_stay_hookable before).

🤖 Generated with Claude Code


🔄 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/horizon-rust/horizon/pull/6375 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/loot-hook-test-crlf` --- ### 📝 Commits (3) - [`9e09e3c`](https://github.com/horizon-rust/horizon/commit/9e09e3c4c18ff06cff867c8916af04cc37e2d1b8) native_loot_kinds_stay_hookable reads loot.rs with LF line endings - [`a8ac6c8`](https://github.com/horizon-rust/horizon/commit/a8ac6c8323f4f71838f3190c94d5ae228505d374) Merge remote-tracking branch 'upstream/main' into fix/loot-hook-test-crlf - [`7630a2a`](https://github.com/horizon-rust/horizon/commit/7630a2abc35123419291e1e9138eb43ba3ffced2) native_breathing_stays_hookable reads breathing.rs with LF line endings ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_hooks.rs` (+2 -2) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Fixes #6372. `game::native_hooks::tests::native_loot_kinds_stay_hookable` reads `horizon-world/src/loot.rs` with `include_str!` and looks for `"\n}\n"` to find the end of each loot hook's body. A Windows checkout with Git for Windows' default `core.autocrlf=true` has the file in CRLF, so the search found nothing, `find(..).unwrap()` panicked, and `pr_ready` reported a failure on every branch there (#6321, #6322, #6337 and #6348 all note it). The test now normalises the line endings first with `.replace("\r\n", "\n")`, as the tests next to it in the same module already do. One line; no behaviour change, and CI (LF checkout) runs it as before. **Update:** `main` since added `native_breathing_stays_hookable`, which reads `breathing.rs` the same way and fails the same way on Windows. The second commit normalises it too (after merging `main` into this branch). With both, the 21 `native_hooks` tests pass on this Windows checkout. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [x] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference none ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-G0M27UC, against upstream/main at 62bdd29b2, 10 min 3 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +1 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (3 min 8 s) | | rustfmt | ✅ (16 s) | | clippy | ✅ (2 min 12 s) | | tests: horizon-client | ✅ 563 passed (4 min 19 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on Windows with `core.autocrlf=true`: `tests: horizon-client` now passes in full here (it failed on `native_loot_kinds_stay_hookable` before). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:27:44 +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
horizon-rust/horizon#6832
No description provided.