Repository navigation
fix: Ruby の演算子の後の空白の有無を保ち、空白だけの更新を報告しない - #134
Merged
Merged
Conversation
Gemfile で演算子の後に空白のない ~>2.2 を書くと、範囲内に新しい版がある だけで更新として報告し、~> 2.2 に書き換えていた。指定の意味は変わらず、 空白だけの差分になる。次の実行からは latest になっていた。 parser/ruby.rs が単一の制約の接頭辞を "~> " / "= " / ">= " などに固定して いたので、書き換え後の表記 (~> 2.2) が元の表記 (~>2.2) と一致せず、何も 変わらない更新の判定 (formatted == raw) が働かなかった。 - 単一の制約 (~> / = / >= / > / <= / <) の接頭辞を、元の表記の演算子と、 その後の空白の有無そのままにした (operator_spec)。~>2.2 は ~>2.3 に、 ~> 2.2 は ~> 2.3 に書き換え、範囲内の版しかなければ latest と判定する。 - AGENTS.md に書いた。 テスト: ~>2.2・~> 2.2・~> 2.2・>=1.0・=1.2.3 の空白を書き戻しでも保つ こと。~>2.2 は範囲内の版 (2.2.0〜2.2.9) しかなければ更新しないこと。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Gemfile で演算子の後に空白のない
~>2.2を書くと、範囲内に新しい版があるだけで更新として報告し、~> 2.2に書き換えていました。指定の意味は変わらず、空白だけの差分になります。次の実行からはlatestになっていました。元の書き方 (空白の有無) を保ち、範囲内の版しかなければlatestと判定します。原因
parser/ruby.rsが単一の制約の接頭辞を"~> "/"= "/">= "などに固定していたので、書き換え後の表記 (~> 2.2) が元の表記 (~>2.2) と一致せず、何も変わらない更新の判定 (formatted == raw) が働きませんでした。変更内容
~>/=/>=/>/<=/<) の接頭辞を、元の表記の演算子と、その後の空白の有無そのままにした (operator_spec)。~>2.2は~>2.3に、~> 2.2は~> 2.3に書き換え、範囲内の版しかなければlatestと判定する。>=1.0などの空白のない比較演算子も、これまでは>= 1.5.0のように空白を足して書き換えていました。同じ原因なので、あわせて元の書き方を保ちます。検証
parser::ruby::tests::test_operator_spacing_is_preserved_when_updated(~>2.2・~> 2.2・~> 2.2・>=1.0・=1.2.3の空白を書き戻しでも保つ)parser::ruby::tests::test_pessimistic_without_space_is_latest_within_its_range(~>2.2は範囲内の版 (2.2.0〜2.2.9) しかなければ更新しない)parser::ruby::tests::test_parse_pessimistic_no_space(接頭辞が~>になる)cargo fmt --all -- --check: passcargo clippy --locked --all-targets -- -D warnings: passcargo test --locked(Windows): passCloses #107
🤖 Generated with Claude Code