chore: rector.php のルール重複登録を解消 - #7028
Open
dotani1111 wants to merge 1 commit into
Open
Conversation
- ContainerGetNameToTypeInTestsRector は有効化済みのセットに含まれており、 withRules() での再登録が Rector の重複登録警告を発生させていた - withRules() の登録を削除し、運用上の注意は同ルールを指定している withSkip() へ集約 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.4 #7028 +/- ##
==========================================
- Coverage 77.18% 77.15% -0.04%
==========================================
Files 564 564
Lines 28123 28123
==========================================
- Hits 21707 21697 -10
- Misses 6416 6426 +10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
概要(Overview・Refs Issue)
rector.phpのwithRules()に登録しているContainerGetNameToTypeInTestsRectorが、有効化済みのセットにも含まれているため、Rector 実行時に重複登録の警告が出ています。withRules()からの登録を削除して警告を解消します。方針(Policy)
ルール自体は引き続き有効にしたいため、
withRules()の登録のみを削除しました。withRules()に添えていた運用上の注意(クラス名のエイリアスを持たない private サービスはget($serviceId)の形にして変換対象から外す)は、同じルールを指定しているwithSkip()の箇所へ移しています。実装に関する補足(Appendix)
vendor/bin/rector list-rulesで、削除後もRector\Symfony\Symfony34\Rector\Closure\ContainerGetNameToTypeInTestsRectorが Loaded Rector rules に含まれることを確認しています。セット側で有効なため、ルールが無効化されることはありません。
テスト(Test)
ローカル(PHP 8.3 / 現在の
composer.lockの rector 2.3.9)で以下を実行しています。vendor/bin/rector list-rules: 警告が出ないこと、対象ルールが Loaded Rector rules に残ることvendor/bin/rector process --dry-run: 変更検出なしvendor/bin/php-cs-fixer fix --dry-run: 指摘なしvendor/bin/phpstan analyse src: エラーなしRector の設定ファイルのみの変更で、アプリケーションコードには手を入れていません。
相談(Discussion)
特にありません。
マイナーバージョン互換性保持のための制限事項チェックリスト
レビュワー確認項目
Summary by CodeRabbit
リファクタリング
ユーザーへの影響