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

chore: supress incorrect tarpaulin checks #208

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sylvia-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ pub fn entry_points(attr: TokenStream, item: TokenStream) -> TokenStream {
entry_points_impl(attr.into(), item.into()).into()
}

#[cfg(not(tarpaulin_include))]
fn entry_points_impl(attr: TokenStream2, item: TokenStream2) -> TokenStream2 {
fn inner(_attr: TokenStream2, item: TokenStream2) -> syn::Result<TokenStream2> {
let input: ItemImpl = parse2(item)?;
Expand Down
4 changes: 3 additions & 1 deletion sylvia-derive/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
}
}

#[cfg(not(tarpaulin_include))]
pub fn emit_ctx_params(self) -> TokenStream {
use MsgType::*;

Expand All @@ -100,6 +101,7 @@
}
}

#[cfg(not(tarpaulin_include))]
pub fn emit_ep_name(self) -> TokenStream {
use MsgType::*;

Expand Down Expand Up @@ -146,7 +148,7 @@
MsgType::Query => parse_quote! { ContractQueryMsg },
MsgType::Instantiate => parse_quote! { InstantiateMsg },
MsgType::Migrate => parse_quote! { MigrateMsg },
MsgType::Reply => parse_quote! { ReplyMsg },

Check warning on line 151 in sylvia-derive/src/parser.rs

View check run for this annotation

Codecov / codecov/patch

sylvia-derive/src/parser.rs#L151

Added line #L151 was not covered by tests
MsgType::Sudo => todo!(),
}
}
Expand Down Expand Up @@ -489,6 +491,7 @@
}
}

#[cfg(not(tarpaulin_include))]
pub fn emit_default_entry_point(
custom_msg: &Type,
name: &Type,
Expand All @@ -497,7 +500,6 @@
) -> TokenStream {
let sylvia = crate_module();

#[cfg(not(tarpaulin_include))]
let resp_type = match msg_type {
MsgType::Query => quote! { #sylvia ::cw_std::Binary },
_ => quote! { #sylvia ::cw_std::Response < #custom_msg > },
Expand Down Expand Up @@ -533,9 +535,9 @@
.filter_map(
|attr| match OverrideEntryPoint::parse.parse2(attr.tokens.clone()) {
Ok(entry_point) => Some(entry_point),
Err(err) => {
emit_error!(attr.span(), err);
None

Check warning on line 540 in sylvia-derive/src/parser.rs

View check run for this annotation

Codecov / codecov/patch

sylvia-derive/src/parser.rs#L538-L540

Added lines #L538 - L540 were not covered by tests
}
},
)
Expand Down
1 change: 1 addition & 0 deletions sylvia-derive/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use syn::{
use crate::check_generics::CheckGenerics;
use crate::message::MsgField;

#[cfg(not(tarpaulin_include))]
pub fn filter_wheres<'a>(
clause: &'a Option<WhereClause>,
generics: &[&GenericParam],
Expand Down
3 changes: 3 additions & 0 deletions sylvia/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub struct SudoCtx<'a, C: CustomQuery = Empty> {
pub env: Env,
}

#[cfg(not(tarpaulin_include))]
impl<C: CustomQuery> ExecCtx<'_, C> {
pub fn branch(&'_ mut self) -> ExecCtx<'_, C> {
ExecCtx {
Expand All @@ -42,6 +43,7 @@ impl<C: CustomQuery> ExecCtx<'_, C> {
}
}

#[cfg(not(tarpaulin_include))]
impl<C: CustomQuery> InstantiateCtx<'_, C> {
pub fn branch(&'_ mut self) -> InstantiateCtx<'_, C> {
InstantiateCtx {
Expand All @@ -52,6 +54,7 @@ impl<C: CustomQuery> InstantiateCtx<'_, C> {
}
}

#[cfg(not(tarpaulin_include))]
impl<C: CustomQuery> SudoCtx<'_, C> {
pub fn branch(&'_ mut self) -> SudoCtx<'_, C> {
SudoCtx {
Expand Down
Loading