Skip to content

feat(typing): improve type coverage in themes.theme - #1146

Open
jorenham wants to merge 1 commit into
has2k1:mainfrom
jorenham:typing/themes.theme/coverage
Open

jorenham wants to merge 1 commit into
has2k1:mainfrom
jorenham:typing/themes.theme/coverage

Conversation

@jorenham

@jorenham jorenham commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

As promosed in #1140, here are some type-coverage improvements, most of which involves the theme.__init__ parameters.

I added a script in tools that I've used to generate these param annotations. Unfortunately it's not a complete solution, because it required fixing a couple of annotations afterwards, and I also deduped a lot of duplication in the annotations using type aliases.

In order to avoid a Pyright error, I had to annotate a param in _utils/yippie.py (Pyright would otherwise infer position as str, which isn't assignable to the plot_tag_position literal).

This increases public type coverage (measured with uvx pyrefly coverage check --public-only plotnine) from 58.84% to 64.95% (+6.11%). See https://jorenham.github.io/typestats/dashboard/report/#plotnine for a fancy type-coverage dashboard.

FYI; I'm planning on opening some other type-coverage PRs like this one soon, and I was thinking of doing themes.themeable next :)

@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.92%. Comparing base (238522f) to head (e1f1048).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1146   +/-   ##
=======================================
  Coverage   88.92%   88.92%           
=======================================
  Files         229      229           
  Lines       17320    17322    +2     
  Branches     2204     2204           
=======================================
+ Hits        15402    15404    +2     
  Misses       1289     1289           
  Partials      629      629           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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