Repository navigation
fix: 書き換え不要の指定でも --max-change で除外した版があれば max-change と報告する - #133
Merged
Merged
Conversation
--max-change で新しい版を除外した結果、書き換えの必要がない指定 (ワイルドカードや部分版) は、max-change=<LEVEL> ではなく latest と報告されて いた。package.json の "lodash": "4.x" で公開版が 4.17.21 と 5.0.0、 --max-change minor のとき、結果は latest (JSON の理由は already_latest) に なり、同じ候補で "^4.17.21" なら max-change=minor と報告していた。 RubyGems の ~> 7.1 (7.1.4, 7.2.0、--max-change patch) や mise の node = "22" (22.11.0, 24.0.0、--max-change minor) も同じだった。マニフェスト への書き込みは正しく (何も書かない)、報告の理由だけが違っていた。 update/mod.rs の select_latest_candidate は、書き換え後の表記が今の表記と 同じとき (何も変わらない更新の防止) に AlreadyLatest を返し、この分岐では --max-change で除外した新しい版の有無を見ていなかった。ChangeLevelLimited を 返していたのは、許された最新の候補が現在版以下の分岐だけだった。 - --max-change で除外した、現在版より新しい候補の判定を excluded_by_max_change にまとめ、現在版が許された最新以上の分岐と、書き換え後の表記が同じ分岐の 両方で使う。除外した版があれば ChangeLevelLimited を返す。 - docs/usage (英語・日本語) と AGENTS.md に書いた。 テスト: npm の 4.x・RubyGems の ~> 7.1・mise の 22 で、--max-change で除外 した版があれば max-change=<LEVEL>、なければこれまでどおり latest になること。 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.
概要
--max-changeで新しい版を除外した結果、書き換えの必要がない指定 (ワイルドカードや部分版) は、max-change=<LEVEL>ではなくlatestと報告されていました。package.json の"lodash": "4.x"で公開版が 4.17.21 と 5.0.0、--max-change minorのとき、結果はlatest(JSON の理由はalready_latest) になり、同じ候補で"^4.17.21"ならmax-change=minorと報告していました。RubyGems の~> 7.1(7.1.4, 7.2.0、--max-change patch) や mise のnode = "22"(22.11.0, 24.0.0、--max-change minor) も同じでした。マニフェストへの書き込みは正しく (何も書かない)、報告の理由だけが違っていました。原因
update/mod.rsのselect_latest_candidateは、書き換え後の表記が今の表記と同じとき (何も変わらない更新の防止) にAlreadyLatestを返し、この分岐では--max-changeで除外した新しい版の有無を見ていませんでした。ChangeLevelLimitedを返していたのは、許された最新の候補が現在版以下の分岐だけでした。変更内容
--max-changeで除外した、現在版より新しい候補の判定をexcluded_by_max_changeにまとめ、現在版が許された最新以上の分岐と、書き換え後の表記が同じ分岐の両方で使う。除外した版があればChangeLevelLimitedを返す。検証
update::tests::unchanged_specs_report_versions_excluded_by_max_change(npm の4.x・RubyGems の~> 7.1・mise の22で、--max-changeで除外した版があればmax-change=<LEVEL>、なければこれまでどおりlatest)cargo fmt --all -- --check: passcargo clippy --locked --all-targets -- -D warnings: passcargo test --locked(Windows): passCloses #106
🤖 Generated with Claude Code