Skip to content

feat: toml formatting verification in CI #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ jobs:
- uses: Swatinem/rust-cache@v2
- run: scripts/clippy.sh

taplo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: baptiste0928/cargo-install@v3
with:
crate: taplo-cli
version: '0.9.0'
locked: true
- run: scripts/taplo.sh

run-python-tests:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -133,6 +146,7 @@ jobs:
- format
- run-python-tests
- run-tests
- taplo
- udeps
steps:
- name: Decide whether all the needed jobs succeeded or failed
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ rand_distr = "0.4.3"
rstest = "0.17.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.116"
starknet_api = "0.12.0-dev.2"
starknet-types-core = { version = "0.0.11", features = ["hash"] }
starknet_api = "0.12.0-dev.2"
strum = " 0.26.2"
strum_macros = "0.26.2"
thiserror = "1.0.58"
tokio = { version = "1", features = ["full"] }

[workspace.lints.rust]
warnings = "deny"
future-incompatible = "deny"
nonstandard-style = "deny"
rust-2018-idioms = "deny"
unused = "deny"
warnings = "deny"

[workspace.lints.clippy]
as_conversions = "deny"
Expand Down
4 changes: 2 additions & 2 deletions crates/committer_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ pretty_assertions.workspace = true

[dependencies]
clap.workspace = true
committer = { path = "../committer" , features = ["testing"] }
committer = { path = "../committer", features = ["testing"] }
derive_more.workspace = true
ethnum.workspace = true
rand.workspace = true
rand_distr.workspace = true
serde.workspace = true
serde_json.workspace = true
starknet-types-core.workspace = true
starknet_api.workspace = true
strum.workspace = true
strum_macros.workspace = true
starknet_api.workspace = true
thiserror.workspace = true
tokio.workspace = true
6 changes: 6 additions & 0 deletions scripts/taplo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# To auto-fix formatting install taplo (`cargo install taplo-cli`) and run `taplo format`.
# Formatting options can be configured in the root `taplo.toml` file.

taplo format --check --diff 1>&2
11 changes: 11 additions & 0 deletions taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[formatting]
column_width = 100
reorder_arrays = true
reorder_keys = true

# Don't reorder the "package" section(s).
[[rule]]
formatting = { reorder_keys = false }
keys = ["package", "workspace.package"]

# Other configs from here: https://taplo.tamasfe.dev/configuration/formatter-options.html.
Loading