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

Style refactor: use contract.Assertf instead of panic #1527

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

t0yv0
Copy link
Member

@t0yv0 t0yv0 commented Nov 15, 2023

Follow up on a recent PR feedback to use contract.Assertf instead of panic in tfgen block schema recognition.

@t0yv0 t0yv0 requested a review from iwahbe November 15, 2023 18:42
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

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

Comparison is base (7498935) 62.01% compared to head (1d18af8) 57.96%.
Report is 1 commits behind head on master.

Files Patch % Lines
pf/internal/schemashim/block_schema.go 45.45% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1527      +/-   ##
==========================================
- Coverage   62.01%   57.96%   -4.05%     
==========================================
  Files         185      286     +101     
  Lines       32895    39670    +6775     
==========================================
+ Hits        20399    22995    +2596     
- Misses      11355    15338    +3983     
- Partials     1141     1337     +196     

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

return r
}
panic(fmt.Errorf("List-nested block has a ListTypeable type that does not implement "+
"TypeWithElementType: %v", s.block.Type()))
contract.Assertf(false, "List-nested block has a ListTypeable type that does not implement "+
Copy link
Member

Choose a reason for hiding this comment

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

I believe we have contract.Failef

Suggested change
contract.Assertf(false, "List-nested block has a ListTypeable type that does not implement "+
contract.Failf("List-nested block has a ListTypeable type that does not implement "+

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.

None yet

2 participants