Skip to content

fix(profiles): align DescriptorProfile.post_init signature with base#37

Merged
discreteds merged 1 commit into
developfrom
bugfix/profile-post-init-signature
Apr 18, 2026
Merged

fix(profiles): align DescriptorProfile.post_init signature with base#37
discreteds merged 1 commit into
developfrom
bugfix/profile-post-init-signature

Conversation

@discreteds

Copy link
Copy Markdown
Member

Summary

  • MountainAshBaseSettings.post_init declares reinitialise: Optional[bool] = False, but DescriptorProfile.post_init narrowed it to bool = False.
  • Pyright flagged this as an LSP-violating override for any subclass that multi-inherits both parents — downstream mountainash-utils-files storage settings had to choose which parent to satisfy (warnings on the other).
  • Widening the override to Optional[bool] resolves the inconsistency. Runtime behavior is unchanged (None was already coerced to falsy).

Test plan

  • hatch run test:test — 368 passed
  • pyright src/mountainash_settings/profiles/profile.py — 0 errors, 0 warnings
  • Verified downstream mountainash-utils-files pyright drops from 13 → 12 warnings after upstream reinstall (743 tests still pass)

🤖 Generated with Claude Code

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>
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Apr 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.90%. Comparing base (18de5ad) to head (67f51b0).
⚠️ Report is 4 commits behind head on develop.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

@discreteds discreteds merged commit 88eabe9 into develop Apr 18, 2026
6 checks passed
@discreteds discreteds deleted the bugfix/profile-post-init-signature branch April 18, 2026 14:24
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.

1 participant