nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: CosmWasm/sylvia
Pull request #333 (2024-03-27 10:14:50)

docs: Add `doc_cfg` in `lib.rs` to fix compilation on docsrs

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/CosmWasm/sylvia/pull/333?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 85.25%. Comparing base [(`0c16124`)](https://app.codecov.io/gh/CosmWasm/sylvia/commit/0c16124c0cea50c52f05ec7b25077459cb363ec0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm) to head [(`9eb300b`)](https://app.codecov.io/gh/CosmWasm/sylvia/pull/333?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm).

> :exclamation: Current head 9eb300b differs from pull request most recent head 58f1aa3. Consider uploading reports for the commit 58f1aa3 to get more accurate results


<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main     #333   +/-   ##
=======================================
  Coverage   85.25%   85.25%           
=======================================
  Files          37       37           
  Lines        2700     2700           
=======================================
  Hits         2302     2302           
  Misses        398      398           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/CosmWasm/sylvia/pull/333?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=CosmWasm).


Patch:
diff --git a/sylvia/src/lib.rs b/sylvia/src/lib.rs
index dff12ea..1945c6f 100644
--- a/sylvia/src/lib.rs
+++ b/sylvia/src/lib.rs
@@ -1,3 +1,4 @@
+#![cfg_attr(docsrs, feature(doc_cfg))]
 //! Framework for creating CosmWasm Smart Contract with high-level abstraction layer
 //!
 //! Most of implementation lies in `sylvia-derive` crate which is reexported here


Test patch:
diff --git a/sylvia/src/multitest.rs b/sylvia/src/multitest.rs
index e302702..3a06bad 100644
--- a/sylvia/src/multitest.rs
+++ b/sylvia/src/multitest.rs
@@ -1,6 +1,6 @@
 //! This module provides utilities to work with `cw_multi_test` crate.
 //!
-//! Example usage:
+//! ## Example usage:
 //! ```rust
 //! # use sylvia::cw_std::{Response, StdResult};
 //! # use sylvia::types::{ExecCtx, InstantiateCtx, QueryCtx};
Repository: CosmWasm/sylvia
Pull request #462 (2024-11-21 14:40:08)

feat: Reexport cw-utils without a flag


Patch:
diff --git a/examples/Cargo.lock b/examples/Cargo.lock
index 7cc9636..1fc09af 100644
--- a/examples/Cargo.lock
+++ b/examples/Cargo.lock
@@ -1271,6 +1271,7 @@ dependencies = [
  "cosmwasm-schema",
  "cosmwasm-std",
  "cw-multi-test",
+ "cw-utils",
  "derivative",
  "konst",
  "schemars",
diff --git a/sylvia/Cargo.toml b/sylvia/Cargo.toml
index 92df9d7..754ca0e 100644
--- a/sylvia/Cargo.toml
+++ b/sylvia/Cargo.toml
@@ -20,7 +20,6 @@ cosmwasm_1_2 = [
     "cosmwasm-std/cosmwasm_1_2",
     "cw-multi-test/cosmwasm_1_2",
     "sylvia-derive/cosmwasm_1_2",
-    "dep:cw-utils",
     "cosmwasm_1_1",
 ]
 cosmwasm_1_3 = [
@@ -51,7 +50,7 @@ konst = "0.3.8"
 cw-multi-test = { workspace = true, features = ["staking"], optional = true }
 anyhow = { workspace = true, optional = true }
 derivative = { version = "2.2.0" }
-cw-utils = { workspace = true, optional = true }
+cw-utils = { workspace = true }
 
 [dev-dependencies]
 cw-multi-test = { workspace = true, features = ["staking"] }
diff --git a/sylvia/src/lib.rs b/sylvia/src/lib.rs
index 4b0a1ea..70e171a 100644
--- a/sylvia/src/lib.rs
+++ b/sylvia/src/lib.rs
@@ -1,7 +1,7 @@
 #![cfg_attr(docsrs, feature(doc_cfg))]
-//! Framework for creating CosmWasm Smart Contract with high-level abstraction layer
+//! Framework for creating CosmWasm Smart Contract with high-level abstraction layer.
 //!
-//! Most of implementation lies in `sylvia-derive` crate which is reexported here
+//! Most of implementation lies in `sylvia-derive` crate which is reexported here.
 
 pub mod builder;
 pub mod ctx;
@@ -18,8 +18,6 @@ pub use anyhow;
 #[cfg_attr(docsrs, doc(cfg(feature = "mt")))]
 #[cfg(feature = "mt")]
 pub use cw_multi_test;
-#[cfg_attr(docsrs, doc(cfg(feature = "cosmwasm_1_2")))]
-#[cfg(feature = "cosmwasm_1_2")]
 pub use cw_utils;
 #[cfg_attr(docsrs, doc(cfg(feature = "mt")))]
 #[cfg(feature = "mt")]


Test patch:
diff --git a/sylvia/tests/reply_data.rs b/sylvia/tests/reply_data.rs
index 8d282f4..ca822c5 100644
--- a/sylvia/tests/reply_data.rs
+++ b/sylvia/tests/reply_data.rs
@@ -1,12 +1,12 @@
 use cosmwasm_schema::cw_serde;
 use cosmwasm_std::to_json_binary;
 use cw_storage_plus::Item;
-use cw_utils::{MsgInstantiateContractResponse, ParseReplyError};
 use noop_contract::sv::{Executor, NoopContractInstantiateBuilder};
 use sv::SubMsgMethods;
 use sylvia::builder::instantiate::InstantiateBuilder;
 use sylvia::ctx::{ExecCtx, InstantiateCtx, ReplyCtx};
 use sylvia::cw_std::{Addr, Binary, Response, StdError, SubMsg};
+use sylvia::cw_utils::{MsgInstantiateContractResponse, ParseReplyError};
 use sylvia::types::Remote;
 use sylvia::{contract, entry_points};
 use thiserror::Error;
Repository: aquasecurity/kube-bench
Pull request #1440 (2023-05-12 10:09:38)

fix: ignore the error from findConfigFile
When we are trying to access a file from a directory which is not present then we get different error. We dont have standard error method to check the msg so added string match for this case
#1439

deven0t: Hi @chen-keinan 
Can you review this?

Thanks,
Devendra
chen-keinan: @deven0t lgtm , just need rebase

Patch:
diff --git a/cmd/util.go b/cmd/util.go
index d67d854..59f20b1 100644
--- a/cmd/util.go
+++ b/cmd/util.go
@@ -241,7 +241,7 @@ func findConfigFile(candidates []string) string {
 		if err == nil {
 			return c
 		}
-		if !os.IsNotExist(err) {
+		if !os.IsNotExist(err) && !strings.HasSuffix(err.Error(), "not a directory") {
 			exitWithError(fmt.Errorf("error looking for file %s: %v", c, err))
 		}
 	}


Test patch:
diff --git a/cmd/util_test.go b/cmd/util_test.go
index ecdd04c..8c9327d 100644
--- a/cmd/util_test.go
+++ b/cmd/util_test.go
@@ -15,6 +15,7 @@
 package cmd
 
 import (
+	"errors"
 	"io/ioutil"
 	"os"
 	"path/filepath"
@@ -233,6 +234,7 @@ func TestFindConfigFile(t *testing.T) {
 		{input: []string{"myfile"}, statResults: []error{nil}, exp: "myfile"},
 		{input: []string{"thisfile", "thatfile"}, statResults: []error{os.ErrNotExist, nil}, exp: "thatfile"},
 		{input: []string{"thisfile", "thatfile"}, statResults: []error{os.ErrNotExist, os.ErrNotExist}, exp: ""},
+		{input: []string{"thisfile", "/etc/dummy/thatfile"}, statResults: []error{os.ErrNotExist, errors.New("stat /etc/dummy/thatfile: not a directory")}, exp: ""},
 	}
 
 	statFunc = fakestat