Skip to content

fix: install 後も既存ファイルの改行形式を保持する - #63

Merged
owayo merged 1 commit into
mainfrom
fix/issue-62-preserve-install-line-endings
Oct 25, 2026
Merged

owayo merged 1 commit into
mainfrom
fix/issue-62-preserve-install-line-endings

Conversation

@owayo

@owayo owayo commented Oct 25, 2026

Copy link
Copy Markdown
Owner

概要

--install 中の外部コマンドが LF のファイルを CRLF で書き直しても、実行前の改行形式をファイルごとに保持します。Cargo の age 調整と mise の platform lock 補修による再書き込みも対象です。

直接のマニフェスト更新は既に改行を保持していましたが、外部コマンドの出力を採用する処理には改行を戻す処理がありませんでした。管理対象ファイルと監査の受領書を検証した後、既存のチェック付きアトミック書き込みで改行を戻し、復元用の追跡状態も更新します。

新規ファイル、元から混在する改行、改行のないファイル、バイナリ、mise の sidecar は変換しません。変換は解決した版・書き込み後の末尾改行・権限を保持し、外部編集の判定には元のバイト列の完全一致を使います。使い方の英語版と日本語版にも保持範囲を追記しました。

検証

  • make ci: format、clippy、全テスト成功。
  • Cargo install と age 調整の LF/CRLF 保持、mise platform lock 補修時のファイル別保持を確認。修正前には回帰テストが失敗することも確認済み。
  • バイナリ・混在改行・新規ファイルの除外、改行だけの外部編集の保護、install 失敗時の元バイト列への復元を確認。
  • astro-sight review --git: 公開 API の変更、未解決の影響なし。

Closes #62

@owayo owayo self-assigned this Oct 25, 2026
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91616874-50b8-406f-a242-4759b3477e89
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

外部コマンドが書いた改行をそのまま採用していたため、Windows では
LF のファイルが CRLF になり、更新箇所以外まで差分に出ることがあった。

コマンドの管理対象と Cargo age 監査の受領書を検証した後に、既存の
テキストファイルを元の LF または CRLF へ戻す。更新した内容、末尾改行、
権限を保ち、書き戻したバイト列を復元用の追跡状態へ反映する。
新規ファイル、混在改行、バイナリと mise の sidecar は変換しない。
改行を書き戻せない場合は成功扱いにせず、既存の復元処理へ進める。
失敗時も採用済みの生バイト列を追跡し、外部編集の検知を維持する。

Cargo と mise の再書き込み、失敗時の復元、外部編集の保護を検証する
回帰テストを追加し、使い方の英語版と日本語版に保持範囲を記載した。
@owayo
owayo force-pushed the fix/issue-62-preserve-install-line-endings branch from 69e5918 to 73b650d Compare October 25, 2026 04:55
@owayo
owayo merged commit d32c08d into main Oct 25, 2026
8 checks passed
@owayo
owayo deleted the fix/issue-62-preserve-install-line-endings branch October 25, 2026 05:06
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.

bug: Windows で依存更新時に LF のファイルが CRLF に変わる

1 participant