This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new 230a1bc29 ci: add clippy to some of the binding check ci (#5717)
230a1bc29 is described below

commit 230a1bc297a94c6aedc64c18662839ef12b2dff8
Author: yihong <[email protected]>
AuthorDate: Sun Mar 9 21:20:41 2025 +0800

    ci: add clippy to some of the binding check ci (#5717)
    
    * ci: add clippy to some of the binding check ci
    
    Signed-off-by: yihong0618 <[email protected]>
    
    * fix: make lint happy
    
    Signed-off-by: yihong0618 <[email protected]>
    
    * fix: make fmt happy and maybe fix lua clippy
    
    Signed-off-by: yihong0618 <[email protected]>
    
    * fix: let lua clippy final happy
    
    Signed-off-by: yihong0618 <[email protected]>
    
    * fix: address comments
    
    Signed-off-by: yihong0618 <[email protected]>
    
    ---------
    
    Signed-off-by: yihong0618 <[email protected]>
---
 .github/workflows/ci_bindings_c.yml      | 4 ++++
 .github/workflows/ci_bindings_cpp.yml    | 5 +++++
 .github/workflows/ci_bindings_dotnet.yml | 6 ++++++
 .github/workflows/ci_bindings_lua.yml    | 4 ++++
 .github/workflows/ci_bindings_nodejs.yml | 3 +++
 .github/workflows/ci_bindings_python.yml | 6 ++++++
 bindings/c/src/operator.rs               | 5 +----
 bindings/lua/src/lib.rs                  | 4 ++--
 bindings/nodejs/src/lib.rs               | 6 +++---
 9 files changed, 34 insertions(+), 9 deletions(-)

diff --git a/.github/workflows/ci_bindings_c.yml 
b/.github/workflows/ci_bindings_c.yml
index 28cd852b6..b972d1eed 100644
--- a/.github/workflows/ci_bindings_c.yml
+++ b/.github/workflows/ci_bindings_c.yml
@@ -47,6 +47,10 @@ jobs:
 
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+      - name: Clippy Check
+        working-directory: "bindings/c"
+        run: |
+          cargo clippy -- -D warnings
 
       - name: Build C binding
         working-directory: "bindings/c"
diff --git a/.github/workflows/ci_bindings_cpp.yml 
b/.github/workflows/ci_bindings_cpp.yml
index 9f1fafa70..b693c6c6a 100644
--- a/.github/workflows/ci_bindings_cpp.yml
+++ b/.github/workflows/ci_bindings_cpp.yml
@@ -51,6 +51,11 @@ jobs:
 
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+      
+      - name: Clippy Check
+        working-directory: "bindings/cpp"
+        run: |
+          cargo clippy -- -D warnings
 
       - name: Build Cpp binding && Run tests
         working-directory: "bindings/cpp"
diff --git a/.github/workflows/ci_bindings_dotnet.yml 
b/.github/workflows/ci_bindings_dotnet.yml
index b9fadc7c2..b77c44469 100644
--- a/.github/workflows/ci_bindings_dotnet.yml
+++ b/.github/workflows/ci_bindings_dotnet.yml
@@ -50,6 +50,12 @@ jobs:
           dotnet-version: '7.0.x'
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+      
+      - name: Clippy Check
+        working-directory: "bindings/dotnet"
+        run: |
+          cargo clippy -- -D warnings
+
       - name: Build & Test
         working-directory: "bindings/dotnet"
         run: |
diff --git a/.github/workflows/ci_bindings_lua.yml 
b/.github/workflows/ci_bindings_lua.yml
index 6e71430f2..c411f2455 100644
--- a/.github/workflows/ci_bindings_lua.yml
+++ b/.github/workflows/ci_bindings_lua.yml
@@ -50,6 +50,10 @@ jobs:
           sudo apt-get install -y lua-busted luarocks liblua5.2-dev
       - name: Setup Rust toolchain
         uses: ./.github/actions/setup
+      - name: Clippy Check
+        working-directory: "bindings/lua"
+        run: |
+          cargo clippy -- -D warnings
       - name: Build & Test
         working-directory: "bindings/lua"
         run: |
diff --git a/.github/workflows/ci_bindings_nodejs.yml 
b/.github/workflows/ci_bindings_nodejs.yml
index 26f40d830..8631618bf 100644
--- a/.github/workflows/ci_bindings_nodejs.yml
+++ b/.github/workflows/ci_bindings_nodejs.yml
@@ -83,6 +83,9 @@ jobs:
       - name: Test
         run: cargo test --no-fail-fast
 
+      - name: Check Clippy
+        run: cargo clippy -- -D warnings
+
   linux:
     name: linux - ${{ matrix.settings.target }}
     runs-on: ubuntu-latest
diff --git a/.github/workflows/ci_bindings_python.yml 
b/.github/workflows/ci_bindings_python.yml
index f3fc63d6c..064742515 100644
--- a/.github/workflows/ci_bindings_python.yml
+++ b/.github/workflows/ci_bindings_python.yml
@@ -39,6 +39,12 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v4
+      - name: Setup Rust toolchain
+        uses: ./.github/actions/setup
+      - name: Clippy Check
+        working-directory: "bindings/python"
+        run: |
+          cargo clippy -- -D warnings
       - name: Ruff Check
         working-directory: "bindings/python"
         run: |
diff --git a/bindings/c/src/operator.rs b/bindings/c/src/operator.rs
index c2fb30b2d..eca0284d7 100644
--- a/bindings/c/src/operator.rs
+++ b/bindings/c/src/operator.rs
@@ -87,10 +87,7 @@ fn build_operator(
     schema: core::Scheme,
     map: HashMap<String, String>,
 ) -> core::Result<core::Operator> {
-    let mut op = match core::Operator::via_iter(schema, map) {
-        Ok(o) => o,
-        Err(e) => return Err(e),
-    };
+    let mut op = core::Operator::via_iter(schema, map)?;
     if !op.info().full_capability().blocking {
         let runtime =
             tokio::runtime::Handle::try_current().unwrap_or_else(|_| 
RUNTIME.handle().clone());
diff --git a/bindings/lua/src/lib.rs b/bindings/lua/src/lib.rs
index d220b9c92..21a359b2d 100644
--- a/bindings/lua/src/lib.rs
+++ b/bindings/lua/src/lib.rs
@@ -84,7 +84,7 @@ fn operator_is_exist<'a>(_: &'a Lua, (operator, path): 
(LuaTable<'a>, String)) -
     }
 
     let path = path.as_str();
-    let res = op.is_exist(path);
+    let res = op.exists(path);
     match res {
         Ok(exist) => Ok(exist),
         Err(e) => Err(LuaError::external(e)),
@@ -165,7 +165,7 @@ fn operator_read<'a>(
     let path = path.as_str();
     let data = op.read(path);
     match data {
-        Ok(data) => Ok(lua.create_string(&data.to_vec())?),
+        Ok(data) => Ok(lua.create_string(data.to_vec())?),
         Err(e) => Err(LuaError::external(e)),
     }
 }
diff --git a/bindings/nodejs/src/lib.rs b/bindings/nodejs/src/lib.rs
index 76fceda07..7680f72d0 100644
--- a/bindings/nodejs/src/lib.rs
+++ b/bindings/nodejs/src/lib.rs
@@ -131,7 +131,7 @@ impl Operator {
     /// ```
     #[napi]
     pub async fn is_exist(&self, path: String) -> Result<bool> {
-        self.0.is_exist(&path).await.map_err(format_napi_error)
+        self.0.exists(&path).await.map_err(format_napi_error)
     }
 
     /// Check if this path exists or not synchronously.
@@ -142,7 +142,7 @@ impl Operator {
     /// ```
     #[napi]
     pub fn is_exist_sync(&self, path: String) -> Result<bool> {
-        self.0.blocking().is_exist(&path).map_err(format_napi_error)
+        self.0.blocking().exists(&path).map_err(format_napi_error)
     }
 
     /// Create dir with a given path.
@@ -464,7 +464,7 @@ impl Operator {
     /// ```
     #[napi]
     pub async fn remove(&self, paths: Vec<String>) -> Result<()> {
-        self.0.remove(paths).await.map_err(format_napi_error)
+        self.0.delete_iter(paths).await.map_err(format_napi_error)
     }
 
     /// Remove the path and all nested dirs and files recursively.

Reply via email to