Skip to content

Rust Clippy Linter Settings: How to run Clippy and fmt on different crates and example directories with manifest files #4318

@ScottGibb

Description

@ScottGibb

Thank you to all the devs that have worked on SuperLinter, really great tool!

Im wondering how I can apply Cargo Clippy to the following project:
https://github.com/dysonltd/tmag5273

Initially I created a linting workflow like so:

Clippy:
        name: Clippy
        runs-on: ubuntu-latest
        steps:
          - name: Checkout code
            uses: actions/checkout@v4
          - name: Clippy check on src
            run: cargo clippy --manifest-path Cargo.toml -- -D warnings
          - name: Clippy check on utils
            run: cargo clippy --manifest-path utils/Cargo.toml -- -D warnings
          - name: Clippy check on esp32 example
            run:  cd examples/esp32c3
                  cargo clippy --manifest-path ./Cargo.toml -- -D warnings
            
      Formatter:
        name: Cargo Formatter
        runs-on: ubuntu-latest
        steps:
          - name: Checkout code
            uses: actions/checkout@v4
          - name: Rustfmt check on src
            run: cargo fmt --manifest-path Cargo.toml -- --check
          - name: Rustfmt check on utils
            run: cargo fmt --manifest-path utils/Cargo.toml -- --check
          - name: Rustfmt check on esp32 example
            run: cargo fmt --manifest-path examples/esp32-c3/Cargo.toml -- --check

Is there a way I can apply the following settings to MegaLinter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    O: stale 🤖This issue or pull request is stale, it will be closed if there is no activityquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions