From f13b12fe096d316148574e0e840855eeaa743b28 Mon Sep 17 00:00:00 2001 From: malik672 Date: Thu, 22 Feb 2024 15:02:04 +0100 Subject: [PATCH 1/3] linter --- .github/workflows/lint.yml | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..87d4a5a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,71 @@ +name: lint + +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: [main] + +jobs: + fmt: + name: fmt + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rustfmt + - name: git submodule update + run: git submodule update --init --recursive + - name: cargo fmt + run: cargo +nightly fmt --all -- --check + + clippy: + name: clippy + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + components: clippy + - name: git submodule update + run: git submodule update --init --recursive + - name: cargo clippy + run: cargo clippy --workspace --all-features -- -D warnings + + udeps: + name: udeps + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: install rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: rustfmt + + - name: install udeps + run: cargo install --git https://github.com/est31/cargo-udeps --locked + - name: cargo udeps + run: cargo +nightly udeps + + codespell: + name: codespell + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run CodeSpell + uses: codespell-project/actions-codespell@v2.0 + with: + check_hidden: true + check_filenames: true + skip: .git,Cargo.lock,target,CHANGELOG.md + ignore_words_list: crate,Crate,functio \ No newline at end of file From 3d6e9eb4df62d10f198777e2615f3704c4bd6996 Mon Sep 17 00:00:00 2001 From: malik672 Date: Thu, 22 Feb 2024 15:11:54 +0100 Subject: [PATCH 2/3] fix clippy issues --- .github/workflows/lint.yml | 13 +------------ src/behaviors/deployer.rs | 2 +- src/main.rs | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 87d4a5a..530c539 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -57,15 +57,4 @@ jobs: - name: cargo udeps run: cargo +nightly udeps - codespell: - name: codespell - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Run CodeSpell - uses: codespell-project/actions-codespell@v2.0 - with: - check_hidden: true - check_filenames: true - skip: .git,Cargo.lock,target,CHANGELOG.md - ignore_words_list: crate,Crate,functio \ No newline at end of file + \ No newline at end of file diff --git a/src/behaviors/deployer.rs b/src/behaviors/deployer.rs index 727ea0f..67882ed 100644 --- a/src/behaviors/deployer.rs +++ b/src/behaviors/deployer.rs @@ -68,7 +68,7 @@ impl Behavior<()> for Deployer { pool, }; - messager + let _ = messager .send(To::All, serde_json::to_string(&deployment_data)?) .await; diff --git a/src/main.rs b/src/main.rs index 0ab4d9a..0d778d6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,5 +12,5 @@ async fn main() { let deployer = Agent::builder("deployer").with_behavior(Deployer); world.add_agent(deployer); - world.run().await; + let _ = world.run().await; } From f38bba896d4fa960f3bd068cb3d2e61fee1045c7 Mon Sep 17 00:00:00 2001 From: malik672 Date: Thu, 22 Feb 2024 15:12:29 +0100 Subject: [PATCH 3/3] fix clippy issues --- .github/workflows/lint.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 530c539..99e8b1a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -41,20 +41,4 @@ jobs: - name: cargo clippy run: cargo clippy --workspace --all-features -- -D warnings - udeps: - name: udeps - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: install rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - components: rustfmt - - - name: install udeps - run: cargo install --git https://github.com/est31/cargo-udeps --locked - - name: cargo udeps - run: cargo +nightly udeps - \ No newline at end of file