Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #320 +/- ##
=======================================
Coverage 82.76% 82.76%
=======================================
Files 30 30
Lines 4161 4167 +6
=======================================
+ Hits 3444 3449 +5
- Misses 717 718 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
PR Overview
This PR refactors the parser rules to use stricter type annotations and dedicated classes (GenericParseRule, TagParseRule, and StyleParseRule), while also updating project configuration for dependency groups and switching from mypy to pyright for type‐checking.
- Refactored parse rule types and updated associated methods
- Updated workflow commands and dev dependencies in configuration files
- Minor code cleanups and improved type safety across multiple files
Reviewed Changes
| File | Description |
|---|---|
| prosemirror/model/from_dom.py | Updated imports, refined type annotations, and refactored parse rule classes |
| .github/workflows/test.yml | Changed workflow commands to use uv sync and switched to pyright |
| pyproject.toml | Switched to dependency groups and updated dev dependency versions |
| prosemirror/model/schema.py | Minor refactor using dict.get and walrus operator |
| prosemirror/model/content.py | Added dataclass annotations and improved type annotations |
| prosemirror/model/node.py | Introduced walrus operator for cleaner leafText extraction |
| prosemirror/transform/replace.py | Converted helper classes to dataclasses with slots |
| prosemirror/model/fragment.py | Improved type casts and JSON input handling |
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
prosemirror/model/from_dom.py:41
- Changing the return type of rule_from_node to TagParseRule narrows its contract; please confirm that all consumers expect the more specific type and adjust accordingly if needed.
rule_from_node: Callable[[DOMNode], "TagParseRule"] | None = None
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
PR Overview
This PR updates the project’s typechecking and linting setup by switching to pyright and a newer version of ruff, and it also reorganizes development dependencies into dependency groups. Key changes include updated type definitions for parse rules, improvements to error‐prone index accesses and tag handling in the DOM parser, and updates to CI workflows and dependency versions.
Reviewed Changes
| File | Description |
|---|---|
| prosemirror/model/from_dom.py | Updated import statements, refined type annotations, and index access in cssselect usage. |
| .github/workflows/test.yml | Expanded test coverage to include Python 3.13 and adjusted command invocations. |
| .github/workflows/release.yml | Updated Python version and simplified build/publish commands with uv. |
| pyproject.toml | Transitioned to dependency groups and updated dev dependency versions. |
| prosemirror/model/schema.py | Minor updates to default attribute handling and mark group processing. |
| prosemirror/model/content.py | Added type annotations and used dataclasses for improved clarity. |
| prosemirror/model/node.py | Refined inline text handling with assignment expressions. |
| prosemirror/model/fragment.py | Enforced stricter type casts when parsing JSON fragments. |
| prosemirror/transform/replace.py | Converted several helper classes to dataclasses with slots for improved performance and clarity. |
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
prosemirror/transform/replace.py:339
- [nitpick] Consider using a more descriptive sentinel variable name (e.g., SENTINEL) instead of 'nothing' for clarity.
nothing_ = object()
Also switches to dependency groups for the dev dependencies.