cashubtc / cdk

Cashu Development Kit
MIT License
87 stars 45 forks source link

Running just final-check fails #47

Closed ngutech21 closed 8 months ago

ngutech21 commented 1 year ago

Running just final-check fails with a clippy error:

cargo clippy --locked --offline --workspace --all-targets -- --deny warnings --allow deprecated
warning: /Users/steffen/projects/cashu-crab/bindings/cashu-sdk-ffi/Cargo.toml: unused manifest key: dependencies.futures.feature
    Checking cashu-sdk-ffi v0.1.0 (/Users/steffen/projects/cashu-crab/bindings/cashu-sdk-ffi)
error: variable `Invoice` should have a snake case name
    --> /Users/steffen/projects/cashu-crab/target/debug/build/cashu-sdk-ffi-c6b10692a22ed522/out/cashu_sdk.uniffi.rs:2729:9
     |
2729 |         r#Invoice: ::uniffi::RustBuffer,
     |         ^^^^^^^^^ help: convert the identifier to snake case: `invoice`
     |
     = note: `-D non-snake-case` implied by `-D warnings`

error: variable `Invoice` should have a snake case name
    --> /Users/steffen/projects/cashu-crab/target/debug/build/cashu-sdk-ffi-c6b10692a22ed522/out/cashu_sdk.uniffi.rs:3383:9
     |
3383 |         r#Invoice: ::uniffi::RustBuffer,
     |         ^^^^^^^^^ help: convert the identifier to snake case: `invoice`

error: could not compile `cashu-sdk-ffi` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `cashu-sdk-ffi` (lib test) due to 2 previous errors
error: Recipe `clippy` failed on line 84 with exit code 101

There are multiple issues:

As a quick fix the --deny warnings can be omitted so the final-check action doesn't fails but just prints out a warning.

thesimplekid commented 1 year ago

I've noticed this and looked into it a bit but haven't found a fix.

I know the ci isn't complete at the moment as I've just added the nix and just checks and haven't updated the ci to match.

On November 14, 2023 7:50:53 AM GMT, Steffen @.***> wrote:

Running just final-check fails with a clippy error:

cargo clippy --locked --offline --workspace --all-targets -- --deny warnings --allow deprecated
warning: /Users/steffen/projects/cashu-crab/bindings/cashu-sdk-ffi/Cargo.toml: unused manifest key: dependencies.futures.feature
   Checking cashu-sdk-ffi v0.1.0 (/Users/steffen/projects/cashu-crab/bindings/cashu-sdk-ffi)
error: variable `Invoice` should have a snake case name
   --> /Users/steffen/projects/cashu-crab/target/debug/build/cashu-sdk-ffi-c6b10692a22ed522/out/cashu_sdk.uniffi.rs:2729:9
    |
2729 |         r#Invoice: ::uniffi::RustBuffer,
    |         ^^^^^^^^^ help: convert the identifier to snake case: `invoice`
    |
    = note: `-D non-snake-case` implied by `-D warnings`

error: variable `Invoice` should have a snake case name
   --> /Users/steffen/projects/cashu-crab/target/debug/build/cashu-sdk-ffi-c6b10692a22ed522/out/cashu_sdk.uniffi.rs:3383:9
    |
3383 |         r#Invoice: ::uniffi::RustBuffer,
    |         ^^^^^^^^^ help: convert the identifier to snake case: `invoice`

error: could not compile `cashu-sdk-ffi` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `cashu-sdk-ffi` (lib test) due to 2 previous errors
error: Recipe `clippy` failed on line 84 with exit code 101

There are multiple issues:

  • The CI does not catch this, because it does not run the just actions but uses a matrix build
  • Clippy checks code that is generated by ffi -> I didn't find a solution to exclude the code from the target folder in clippy. Any ideas?

As a quick fix the --deny warnings can be omitted so the final-check action doesn't fails but just prints out a warning.

thesimplekid commented 8 months ago

since bindings are in a different repo now this is avoided