Skip to content

Commit

Permalink
🎉 Gomu Gomu no Gatling
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelStark committed Jul 6, 2023
1 parent 3578c49 commit 656b522
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb


# Added by cargo

/target
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 🦀.
16 changes: 16 additions & 0 deletions crates/gatling/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 6 additions & 0 deletions crates/gatling/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#[derive(Debug, thiserror::Error)]
pub enum GatlingError {
/// Invalid argument was passed.
#[error("invalid args: {0}")]
InvalidArgument(String),
}
1 change: 1 addition & 0 deletions crates/gatling/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod error;
12 changes: 12 additions & 0 deletions crates/gatling/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use log::info;
use std::error::Error;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// Initialize the logger.
env_logger::init();

info!("Starting Gomu Gomu no Gatling...");

Ok(())
}
49 changes: 49 additions & 0 deletions taplo/README.md
Original file line number Diff line number Diff line change
@@ -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).
11 changes: 11 additions & 0 deletions taplo/taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include = ["../**/*.toml"]
exclude = ["../**/bad.toml"]

[formatting]
align_entries = false

[[rule]]
keys = ["dependencies"]

[rule.formatting]
reorder_keys = true

0 comments on commit 656b522

Please sign in to comment.