From a7ff8b9d6f03c3899caf2d31dd4fd650a7bbfa12 Mon Sep 17 00:00:00 2001 From: Waylon Jepsen <57912727+0xJepsen@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:03:56 -0700 Subject: [PATCH] Create lint.yaml (#56) * Create lint.yaml * chore: spell and clippy config --- .github/workflows/lint.yaml | 71 +++++++++++++++++++++++++++++++++++++ README.md | 2 +- src/bindings/mod.rs | 2 ++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..4349c4c --- /dev/null +++ b/.github/workflows/lint.yaml @@ -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 diff --git a/README.md b/README.md index 663ebb4..8aaf929 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Minimal template for simulating contracts with arbiter. This template provides an example of how to build Agent-Based Models (ABM) with evm parity. In this model, you can think of anything that happens as a *behavior* of an agent. Agents can have externally owned accounts (EOAs), interact with each other, and interact with smart contracts. -This repository has an example behavior [`Incrementer`](src/bahaviors/incrementer.rs). The current design philosophy is that the user should only ever have to build agent behaviors implementing the [`Behavior`](https://github.com/primitivefinance/arbiter/blob/fe6b556d715d641aa9378ae20560629ec6ba5b43/arbiter-engine/src/machine.rs#L73) trait. In this example, the `Incrementer` behavior is configured with a [config file](https://github.com/primitivefinance/arbiter-template/blob/main/configs/example.toml). Configuring behaviors with a config file is a design choice we made to enable versatile parameterization at runtime as opposed to compile time. +This repository has an example behavior [`Incrementer`](src/behaviors/incrementer.rs). The current design philosophy is that the user should only ever have to build agent behaviors implementing the [`Behavior`](https://github.com/primitivefinance/arbiter/blob/fe6b556d715d641aa9378ae20560629ec6ba5b43/arbiter-engine/src/machine.rs#L73) trait. In this example, the `Incrementer` behavior is configured with a [config file](https://github.com/primitivefinance/arbiter-template/blob/main/configs/example.toml). Configuring behaviors with a config file is a design choice we made to enable versatile parameterization at runtime as opposed to compile time. ### Prerequisites diff --git a/src/bindings/mod.rs b/src/bindings/mod.rs index ddfa7a8..17be238 100644 --- a/src/bindings/mod.rs +++ b/src/bindings/mod.rs @@ -1 +1,3 @@ +#[allow(clippy::all)] +#[rustfmt::skip] pub mod modified_counter;