yew-bootstrap icon indicating copy to clipboard operation
yew-bootstrap copied to clipboard

Fix issues from `cargo clippy` and add check in the verification

Open dricair opened this issue 10 months ago • 5 comments

I see that cargo clippy returns quite a lot of warnings (8 at the moment) while there is benefit in maintaining the report clean.

I think we should:

  • Fix all warnings. I can do it as they are quite simple.
  • Add a pipeline check as verification when a pull request is proposed for merging. For that it would take more time for me as I don't know how to do it.

dricair avatar Feb 02 '25 16:02 dricair

I fixed a bunch here: https://github.com/isosphere/yew-bootstrap/commit/94eb9e31bbd609b92c3509dd0263ff3f61322844

I agree re: CI; I'm not super familiar with github actions but it should be simple enough for us to shove a "cargo clippy" command in there somewhere.

isosphere avatar Feb 02 '25 16:02 isosphere

Ok I will rebase and verify.

dricair avatar Feb 02 '25 16:02 dricair

I asked Claude AI this question:

On Yew Bootstrap Rust library, how can I add an action to run cargo clippy when someone proposes a pull request?

And it answered (Not verified):

name: Clippy Check

on:
  pull_request:
    branches: [ main ]

jobs:
  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
          
      - name: Run Clippy
        run: cargo clippy -- -D warnings

dricair avatar Feb 02 '25 17:02 dricair

Actually it would make sense to add cargo test as well in the main package. Even if no tests exist at the moment (Although I am going to add some), there are at least all the tests on the examples for the documentation.

dricair avatar Feb 02 '25 17:02 dricair

Note that as I am adding an independent feature, it should launch:

  • cargo clippy --all-features
  • cargo test --all-features

dricair avatar Feb 08 '25 17:02 dricair