Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

整理: verify_mutability() で mutability チェックを置き換え #1363

Merged
merged 5 commits into from
Jun 18, 2024

Conversation

tarepan
Copy link
Contributor

@tarepan tarepan commented May 29, 2024

内容

概要: verify_mutability() で mutability チェックを置き換えてリファクタリング

現在の API mutability チェックはグローバルオブジェクトを利用している。グローバルオブジェクトは影響範囲の理解にコストがかかり、また多重操作によるバグの温床になりやすい。
dependency 関数を明示的に router 引数で渡せば、限局された範囲に静的な関数が渡るため見通しを改善できる。

このような背景から、verify_mutability() で mutability チェックを置き換えるリファクタリングを提案します。

関連 Issue

無し

@tarepan tarepan requested a review from a team as a code owner May 29, 2024 23:29
@tarepan tarepan requested review from Hiroshiba and removed request for a team May 29, 2024 23:29
Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1箇所だけコメントしました!

DIしたいDependsが増えてきたら、ひとまとめにして渡せると良いかもですね!

@tarepan
Copy link
Contributor Author

tarepan commented Jun 9, 2024

@Hiroshiba
全指摘箇所の反映・テストパスを確認しました。Re-review よろしくお願いします。

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

voicevox_engine/app/dependencies.py Outdated Show resolved Hide resolved
@Hiroshiba Hiroshiba merged commit c15dd34 into VOICEVOX:master Jun 18, 2024
4 checks passed
@tarepan tarepan deleted the refactor/immutable branch June 18, 2024 14:45
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.

2 participants