Skip to content

feat: blocked argument#1698

Open
KelvinChung2000 wants to merge 2 commits into
mainfrom
feat/annotated-dataclass-blocks
Open

feat: blocked argument#1698
KelvinChung2000 wants to merge 2 commits into
mainfrom
feat/annotated-dataclass-blocks

Conversation

@KelvinChung2000

Copy link
Copy Markdown
Contributor

close #1689
close #1690

@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.67442% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.52%. Comparing base (8a644dc) to head (18a2415).

Files with missing lines Patch % Lines
cmd2/annotated.py 97.65% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1698      +/-   ##
==========================================
- Coverage   99.58%   99.52%   -0.06%     
==========================================
  Files          23       23              
  Lines        5772     5888     +116     
==========================================
+ Hits         5748     5860     +112     
- Misses         24       28       +4     
Flag Coverage Δ
unittests 99.52% <97.67%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Comment thread cmd2/annotated.py
try:
field_hints = get_type_hints(dc_type, include_extras=True)
except (NameError, AttributeError, TypeError) as exc:
raise TypeError(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test to cover this TypeError case

Comment thread cmd2/annotated.py
expanded: list[_ArgparseArgument] = []
for f in fields(dc_type):
if not f.init:
continue # field(init=False) is not a constructor argument, so it has no command-line value

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test to cover this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants