Skip to content

code cleanup#1264

Merged
raman325 merged 1 commit into
mainfrom
chore/code-cleanup
Jun 15, 2026
Merged

code cleanup#1264
raman325 merged 1 commit into
mainfrom
chore/code-cleanup

Conversation

@raman325

Copy link
Copy Markdown
Owner

Proposed change

Comment and docstring cleanup, plus two small TypeScript refactors. No
behavior changes.

Comment / docstring sweep

  • Strip narrations of past behavior (previously, no longer, the old bool, PR #..., 3.x, the previous behavior) and rewrite
    to describe the current invariant instead.
  • Drop obvious restatement comments and section-banner separators that
    added no information beyond the code they preceded.
  • Where comments documented real invariants — notably _tagged_once in
    akuvox and schlage (lifecycle of the auto-tag guard flag) —
    restore a tightened one-paragraph version rather than delete.

TypeScript

  • ts/generate-view.ts: extract wrapAsFoldOrSection helper so
    maybeGenerateFoldEntityRowCard and
    maybeGenerateFoldEntityRowConditionCard each end in a single
    return wrapAsFoldOrSection(...) call.
  • ts/slot-card.ts: add HassElement and CardHelpers interfaces
    and extend the existing declare global { interface Window } block
    with loadCardHelpers. Drops 3 as any casts plus two inline cast
    forms and the matching eslint-disable-next-line
    @typescript-eslint/no-explicit-any directives.

Type of change

  • Code quality improvements to existing code or addition of tests

Test plan

  • Full Python test suite passes (1277 tests).
  • TypeScript test suite passes (266 tests).
  • Net diff is -32 lines across the Python / TS sources; the bundle
    regeneration adds a comparable amount of generated output.

🤖 Generated with Claude Code

Comment and docstring sweep plus two small refactors:

- Strip narrations, historical PR/version references, and obvious code
  restatements across providers and the domain layer.
- Where comments documented invariants (e.g. ``_tagged_once`` in akuvox
  and schlage), tighten rather than delete.
- ts/generate-view.ts: extract ``wrapAsFoldOrSection`` helper to dedupe
  the fold-vs-section wrapper used by ``maybeGenerateFoldEntityRowCard``
  and ``maybeGenerateFoldEntityRowConditionCard``.
- ts/slot-card.ts: add ``HassElement`` and ``CardHelpers`` interfaces and
  extend the existing ``Window`` global; drop 3 ``as any`` casts plus
  two inline cast forms, removing the matching ``eslint-disable``
  ``no-explicit-any`` directives.

No behavior changes. Bundle regenerated by pre-commit yarn-build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: c61cef7455e6
Copilot AI review requested due to automatic review settings June 15, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added python Pull requests that update Python code javascript Pull requests that update javascript code code-quality Pull requests that improve code quality labels Jun 15, 2026
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.15%. Comparing base (a7fb854) to head (e908ddf).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1264   +/-   ##
=======================================
  Coverage   97.15%   97.15%           
=======================================
  Files          54       54           
  Lines        6538     6543    +5     
  Branches      461      460    -1     
=======================================
+ Hits         6352     6357    +5     
  Misses        186      186           
Flag Coverage Δ
python 97.70% <ø> (ø)
typescript 95.08% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
custom_components/lock_code_manager/__init__.py 95.64% <ø> (ø)
...m_components/lock_code_manager/domain/callbacks.py 100.00% <ø> (ø)
...components/lock_code_manager/domain/credentials.py 100.00% <ø> (ø)
...stom_components/lock_code_manager/domain/models.py 100.00% <ø> (ø)
...om_components/lock_code_manager/domain/services.py 97.29% <ø> (ø)
...nents/lock_code_manager/domain/slot_coordinator.py 95.10% <ø> (ø)
custom_components/lock_code_manager/event.py 100.00% <ø> (ø)
...om_components/lock_code_manager/providers/_base.py 97.05% <ø> (ø)
...onents/lock_code_manager/providers/_zwave_js_uc.py 100.00% <ø> (ø)
...m_components/lock_code_manager/providers/akuvox.py 95.70% <ø> (ø)
... and 10 more
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@raman325 raman325 merged commit 4657eab into main Jun 15, 2026
19 checks passed
@raman325 raman325 deleted the chore/code-cleanup branch June 15, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality Pull requests that improve code quality javascript Pull requests that update javascript code python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants