Repository navigation
chore: more specific types - #63
Conversation
… and __init_subclass__ methods for improved type safety
…for improved type safety
…ns class for improved type safety
…roved type safety
…ses for improved type safety
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The changes are described as typing refinements with no established behavior regression. No actionable merge-blocking risk is identified; normal checks remain appropriate. Pre-merge checks |
|
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (c2b7c2d) Report Missing Report Missing Report Missing Head commit (d365818) 1935 (+6) 1935 (+6) 100.00% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#63) 82 82 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 1929 1935 +6
=========================================
+ Hits 1929 1935 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This pull request focuses on improving type annotations and type safety across the codebase, especially in the encoding and decoding logic of the
qs_codecpackage. The main changes include adding more precise type hints, updating function signatures, and refining the use of generics in several modules. These changes enhance code clarity, maintainability, and compatibility with static type checkers.Type Annotation Improvements
Added explicit type annotations for variables, function parameters, and return types throughout
src/qs_codec/encode.py,src/qs_codec/decode.py, and related modules, increasing type safety and readability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]Updated the
filter_andside_channelparameters and attributes to use more specific generic type annotations, such asWeakKeyDictionary[t.Any, t.Any]andt.Callable[[str, t.Any], t.Any], in both function signatures and class definitions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Module and Import Adjustments
from __future__ import annotationsto several modules to support postponed evaluation of type annotations, which helps with forward references and improves compatibility with static type checkers. [1] [2]Enum and Export Consistency
__all__definitions inenums/decode_kind.pyandenums/sentinel.pyto use typed tuples for consistency and type checking. [1] [2] [3]These changes collectively improve the maintainability and robustness of the code by making type expectations explicit and reducing the risk of runtime errors due to type mismatches.
Summary by CodeRabbit