Skip to content

Commit

Permalink
Create lint.yaml (#56)
Browse files Browse the repository at this point in the history
* Create lint.yaml

* chore: spell and clippy config
  • Loading branch information
0xJepsen authored Mar 5, 2024
1 parent 6211811 commit a7ff8b9
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
71 changes: 71 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
check_hidden: true
check_filenames: true
skip: .git,Cargo.lock,target,CHANGELOG.md
ignore_words_list: crate,Crate,functio
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/bindings/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#[allow(clippy::all)]
#[rustfmt::skip]
pub mod modified_counter;

0 comments on commit a7ff8b9

Please sign in to comment.