Skip to content

refactor(typing): remove remaining local pyright suppressions#28

Merged
tmustier merged 7 commits intomainfrom
refactor/typing-cleanup-remaining-suppressions
Feb 12, 2026
Merged

refactor(typing): remove remaining local pyright suppressions#28
tmustier merged 7 commits intomainfrom
refactor/typing-cleanup-remaining-suppressions

Conversation

@tmustier
Copy link
Owner

Summary

Continue the strict-typing cleanup pass by removing remaining local pyright suppressions in runtime/test modules touched by chart + rendering workflows.

Changes

1) Chart/rendering test + module cleanup

  • clean_slides/chart_render.py

    • removed file-level pyright suppressions (unknown member, unknown variable, private usage)
    • added typed dict coercion helper (_to_str_any_dict)
    • tightened overlay metadata parsing and label/category rewrite handling
    • removed etree._Element private annotations in favor of safer Any-based XML handling
    • normalized chart creation + style/data-label wiring through explicit coercions
    • added public aliases for helper behavior used by tests:
      • chart_def_to_spec
      • python_fmt_to_excel_format
      • waterfall_overlay_label_texts
  • tests/test_chart_cells.py

    • removed file-level pyright suppression header
    • switched imports to public chart-render helper aliases
    • added typed map normalization helper for group-header assertions
    • hardened chart-shape assertions with guarded attribute access
  • tests/test_sizing.py

    • removed file-level pyright suppression header
    • replaced direct protected-member usage with helper-based reflective access (object.__getattribute__) + typed callables
    • preserves intent of internal-behavior regression tests while staying strict-clean

2) Private-usage suppression removal in rendering/introspection helpers

  • clean_slides/xml_helpers.py

    • removed file-level private-usage suppression
    • replaced etree._Element annotations with local XmlElement alias
  • clean_slides/renderer.py

    • removed file-level private-usage suppression
    • replaced etree._Element annotations with local XmlElement alias
    • switched to public subtitle helper import (make_sub_paragraph)
  • clean_slides/content.py

    • added public alias make_sub_paragraph(...) for renderer use
  • clean_slides/inspect_pptx.py

    • removed file-level private-usage suppression
    • replaced etree._Element annotations with local XmlElement alias
    • added helper accessors for protected XML/chart internals to keep strict typing + lint clean

Validation

  • .venv/bin/ruff check clean_slides tests
  • .venv/bin/pyright
  • .venv/bin/pytest -q
  • .venv/bin/pre-commit run --all-files

Result

rg -n "^# pyright:" clean_slides tests now returns only:

  • clean_slides/constants.py (reportConstantRedefinition=false, intentional for mutable module-level reload pattern)

@tmustier tmustier merged commit ab1dd4e into main Feb 12, 2026
6 checks passed
@tmustier tmustier deleted the refactor/typing-cleanup-remaining-suppressions branch February 12, 2026 11:12
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