fix(profiles): align DescriptorProfile.post_init signature with base#37
Merged
Merged
Conversation
MountainAshBaseSettings.post_init declares reinitialise as Optional[bool], but DescriptorProfile narrowed it to bool. Pyright flagged this as an LSP-violating override in any subclass that multi-inherited both parents (e.g. downstream storage settings), forcing downstream code to pick whichever override would only generate warnings in one parent, not both. Widening the override to Optional[bool] matches the base and clears the inconsistency for all downstream consumers. Runtime behavior is unchanged — None was already coerced to falsy. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37 +/- ##
========================================
Coverage 96.90% 96.90%
========================================
Files 31 31
Lines 841 841
Branches 109 109
========================================
Hits 815 815
Misses 15 15
Partials 11 11 ☔ View full report in Codecov by Sentry. |
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.



Summary
MountainAshBaseSettings.post_initdeclaresreinitialise: Optional[bool] = False, butDescriptorProfile.post_initnarrowed it tobool = False.mountainash-utils-filesstorage settings had to choose which parent to satisfy (warnings on the other).Optional[bool]resolves the inconsistency. Runtime behavior is unchanged (Nonewas already coerced to falsy).Test plan
hatch run test:test— 368 passedpyright src/mountainash_settings/profiles/profile.py— 0 errors, 0 warningsmountainash-utils-filespyright drops from 13 → 12 warnings after upstream reinstall (743 tests still pass)🤖 Generated with Claude Code