Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for prosemirror.model #233

Merged
merged 41 commits into from
Nov 16, 2023
Merged

Add types for prosemirror.model #233

merged 41 commits into from
Nov 16, 2023

Conversation

sciyoshi
Copy link
Collaborator

I've been chipping away at this over the past few days. Most of the types came from using monkeytype, then some manual updates to change code to match upstream which wasn't caught with the switchover to TypeScript.

This also uncovered a few bugs that were not identified by tests:

After this it would be nice to add some types from prosemirror.transform, as well as switch a few things over to dataclasses, and maybe experiment with compilation with mypyc... 👀

prosemirror/model/content.py Outdated Show resolved Hide resolved
prosemirror/model/content.py Outdated Show resolved Hide resolved
prosemirror/model/content.py Outdated Show resolved Hide resolved
prosemirror/model/to_dom.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 16, 2023

Codecov Report

Attention: 83 lines in your changes are missing coverage. Please review.

Comparison is base (8b3c7e5) 82.63% compared to head (b061e0e) 83.07%.

Files Patch % Lines
prosemirror/model/content.py 87.95% 20 Missing ⚠️
prosemirror/transform/step.py 77.14% 8 Missing ⚠️
prosemirror/model/from_dom.py 66.66% 7 Missing ⚠️
prosemirror/model/node.py 91.86% 7 Missing ⚠️
prosemirror/transform/map.py 88.88% 6 Missing ⚠️
prosemirror/transform/mark_step.py 87.23% 6 Missing ⚠️
prosemirror/transform/transform.py 92.10% 6 Missing ⚠️
prosemirror/model/replace.py 91.11% 4 Missing ⚠️
prosemirror/model/schema.py 97.05% 4 Missing ⚠️
prosemirror/transform/structure.py 86.66% 4 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   82.63%   83.07%   +0.44%     
==========================================
  Files          30       30              
  Lines        3870     4148     +278     
==========================================
+ Hits         3198     3446     +248     
- Misses        672      702      +30     

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

@ernesto-at-fellow
Copy link
Contributor

@sciyoshi @ericls @p7g
The new types for the transform module were added and this is ready for review. Once this is merged I'll update and prepare the PR for fellow.

@sciyoshi sciyoshi merged commit c87eb14 into main Nov 16, 2023
7 checks passed
@sciyoshi sciyoshi deleted the typing-2 branch November 16, 2023 18:55
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.

3 participants