diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f5b0d93 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +on: [push] + +name: Test + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + + - name: Run cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test diff --git a/.gitignore b/.gitignore index 6985cf1..196e176 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,8 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb + + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..a4b689f --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] +members = ["crates/gatling"] + +[workspace.package] +authors = ["Exploration Team @ StarkWare <@keep-starknet-strange>"] +edition = "2021" +repository = "https://github.com/keep-starknet-strange/gomu-gomu-no-gatling" + diff --git a/README.md b/README.md index 4e886b6..2c097a4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# gomu-gomu-no-gatling -Blazing fast tool to benchmark Starknet sequencers 🦀 +# Gomu Gomu no Gatling + +Blazing fast tool to benchmark Starknet sequencers 🦀. diff --git a/crates/gatling/Cargo.toml b/crates/gatling/Cargo.toml new file mode 100644 index 0000000..2e4a1e1 --- /dev/null +++ b/crates/gatling/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "gatling" +version = "0.1.0" +edition = "2021" +homepage = "https://github.com/keep-starknet-strange/gomu-gomu-no-gatling" +repository = "https://github.com/keep-starknet-strange/gomu-gomu-no-gatling" +categories = ["command-line", "benchmark", "asynchronous"] +keywords = ["starknet", "cairo"] +description = "Gomu Gomu No Gatling is a blazing fast tool to benchmark Starknet sequencers." +readme = "README.md" + +[dependencies] +env_logger = "0.10.0" +log = "0.4.17" +tokio = { version = "1", features = ["full"] } +thiserror = "1.0.40" \ No newline at end of file diff --git a/crates/gatling/src/error.rs b/crates/gatling/src/error.rs new file mode 100644 index 0000000..010ec79 --- /dev/null +++ b/crates/gatling/src/error.rs @@ -0,0 +1,6 @@ +#[derive(Debug, thiserror::Error)] +pub enum GatlingError { + /// Invalid argument was passed. + #[error("invalid args: {0}")] + InvalidArgument(String), +} diff --git a/crates/gatling/src/lib.rs b/crates/gatling/src/lib.rs new file mode 100644 index 0000000..a91e735 --- /dev/null +++ b/crates/gatling/src/lib.rs @@ -0,0 +1 @@ +pub mod error; diff --git a/crates/gatling/src/main.rs b/crates/gatling/src/main.rs new file mode 100644 index 0000000..655e170 --- /dev/null +++ b/crates/gatling/src/main.rs @@ -0,0 +1,12 @@ +use log::info; +use std::error::Error; + +#[tokio::main] +async fn main() -> Result<(), Box> { + // Initialize the logger. + env_logger::init(); + + info!("Starting Gomu Gomu no Gatling..."); + + Ok(()) +} diff --git a/taplo/README.md b/taplo/README.md new file mode 100644 index 0000000..0d097bf --- /dev/null +++ b/taplo/README.md @@ -0,0 +1,49 @@ +# Taplo + +[Taplo](https://github.com/tamasfe/taplo) is a TOML validator and formatter. It +provides a command-line interface (CLI) for working with TOML files. + +## Installation + +You can install Taplo using either cargo or Yarn or NPM. + +### Cargo + +```bash +cargo install taplo-cli --locked +``` + +### Yarn + +```bash +yarn global add @taplo/cli +``` + +### NPM + +```bash +npm install -g @taplo/cli +``` + +### Usage + +To check your TOML files for formatting issues, use the following command: + +```bash +npx @taplo/cli fmt --config taplo.toml --check +``` + +To format all TOML files in your project, use the following command: + +```bash +npx @taplo/cli fmt --config taplo.toml +``` + +This command will automatically format the TOML files, ensuring consistent and +readable formatting. + +### Configuration + +Taplo allows you to customize the formatting rules by adding configuration +options. You can find the available options and how to use them +[here](https://taplo.tamasfe.dev/configuration/formatter-options.html). diff --git a/taplo/taplo.toml b/taplo/taplo.toml new file mode 100644 index 0000000..d8854a4 --- /dev/null +++ b/taplo/taplo.toml @@ -0,0 +1,11 @@ +include = ["../**/*.toml"] +exclude = ["../**/bad.toml"] + +[formatting] +align_entries = false + +[[rule]] +keys = ["dependencies"] + +[rule.formatting] +reorder_keys = true