Skip to content

Commit

Permalink
Add taplo to Makefile and lint.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad committed Jan 26, 2025
1 parent 4613db3 commit aee15a7
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 20 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ jobs:
- name: Clippy
run: make clippy

taplo:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust
- uses: taiki-e/install-action@v2
with:
tool: taplo-cli
- run: taplo fmt --check --verbose

doc:
name: doc
runs-on: ubuntu-latest
Expand Down
22 changes: 13 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,22 @@ tokio = { version = "1.40", features = ["rt-multi-thread"] }
tokio-stream = { version = "0.1" }
tonic = { version = "0.12" }
tracing = { version = "0.1" }
tracing-subscriber = { version = "0.3", features = ["fmt", "json", "env-filter"] }
tracing-subscriber = { version = "0.3", features = [
"fmt",
"json",
"env-filter",
] }

# Lints are set to warn for development, which are promoted to errors in CI.
[workspace.lints.clippy]
# Pedantic lints are set to a lower priority which allows lints in the group to be selectively enabled.
pedantic = { level = "warn", priority = -1 }
cast_possible_truncation = "allow" # Overly many instances especially regarding indices.
ignored_unit_patterns = "allow" # Stylistic choice.
large_types_passed_by_value = "allow" # Triggered by BlockHeader being Copy + 334 bytes.
missing_errors_doc = "allow" # TODO: fixup and enable this.
missing_panics_doc = "allow" # TODO: fixup and enable this.
module_name_repetitions = "allow" # Many triggers, and is a stylistic choice.
must_use_candidate = "allow" # This marks many fn's which isn't helpful.
should_panic_without_expect = "allow" # We don't care about the specific panic message.
cast_possible_truncation = "allow" # Overly many instances especially regarding indices.
ignored_unit_patterns = "allow" # Stylistic choice.
large_types_passed_by_value = "allow" # Triggered by BlockHeader being Copy + 334 bytes.
missing_errors_doc = "allow" # TODO: fixup and enable this.
missing_panics_doc = "allow" # TODO: fixup and enable this.
module_name_repetitions = "allow" # Many triggers, and is a stylistic choice.
must_use_candidate = "allow" # This marks many fn's which isn't helpful.
should_panic_without_expect = "allow" # We don't care about the specific panic message.
# End of pedantic lints.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ format-check: ## Runs Format using nightly toolchain but only in check mode
cargo +nightly fmt --all --check


.PHONY: taplo
taplo: ## Runs Format for all Cargo.toml files
taplo fmt


.PHONY: taplo-check
taplo-check: ## Runs Format for all Cargo.toml files but only in check mode
taplo fmt --check --verbose


.PHONY: lint
lint: format fix clippy ## Runs all linting tasks at once (Clippy, fixing, formatting)
lint: format fix clippy taplo ## Runs all linting tasks at once (Clippy, fixing, formatting)

# --- docs ----------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion bin/faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ miden-lib = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-utils = { workspace = true }
miden-objects = { workspace = true }
miden-tx = { workspace = true, features = ["concurrent"] }
miden-tx = { workspace = true, features = ["concurrent"] }
mime = "0.3"
rand = { workspace = true }
rand_chacha = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion config/miden-faucet.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
endpoint = { host = "localhost", port = 8080 }
endpoint = { host = "localhost", port = 8080 }
node_url = "http://localhost:57291"
timeout_ms = 10000
asset_amount_options = [100, 500, 1000]
Expand Down
10 changes: 8 additions & 2 deletions crates/block-producer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ miden-tx = { workspace = true }
rand = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "net", "macros", "sync", "time"] }
tokio = { workspace = true, features = [
"rt-multi-thread",
"net",
"macros",
"sync",
"time",
] }
tokio-stream = { workspace = true, features = ["net"] }
tonic = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true}
assert_matches = { workspace = true }
miden-air = { workspace = true }
miden-lib = { workspace = true, features = ["testing"] }
miden-node-test-macro = { path = "../test-macro" }
Expand Down
15 changes: 12 additions & 3 deletions crates/store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,25 @@ miden-lib = { workspace = true }
miden-node-proto = { workspace = true }
miden-node-utils = { workspace = true }
miden-objects = { workspace = true }
rusqlite = { version = "0.32.1", features = ["array", "buildtime_bindgen", "bundled"] }
rusqlite = { version = "0.32.1", features = [
"array",
"buildtime_bindgen",
"bundled",
] }
rusqlite_migration = { version = "1.3" }
serde = { version = "1.0", features = ["derive"] }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["fs", "net", "macros", "rt-multi-thread"] }
tokio = { workspace = true, features = [
"fs",
"net",
"macros",
"rt-multi-thread",
] }
tokio-stream = { workspace = true, features = ["net"] }
tonic = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
assert_matches = { workspace = true}
assert_matches = { workspace = true }
miden-node-utils = { workspace = true, features = ["tracing-forest"] }
miden-objects = { workspace = true, features = ["testing"] }
2 changes: 1 addition & 1 deletion crates/test-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true

[dependencies]
quote = { version = "1.0" }
syn = { version = "2.0" , features = ["full", "extra-traits"]}
syn = { version = "2.0", features = ["full", "extra-traits"] }

[lib]
proc-macro = true
7 changes: 5 additions & 2 deletions crates/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ workspace = true

[features]
# Enables depedencies intended for build script generation of version metadata.
vergen = ["dep:vergen", "dep:vergen-gitcl"]
vergen = ["dep:vergen", "dep:vergen-gitcl"]

[dependencies]
anyhow = { version = "1.0" }
Expand All @@ -33,4 +33,7 @@ tracing-subscriber = { workspace = true }
# Optional dependencies enabled by `vergen` feature.
# This must match the version expected by `vergen-gitcl`.
vergen = { "version" = "9.0", optional = true }
vergen-gitcl = { version = "1.0", features = ["cargo", "rustc"], optional = true }
vergen-gitcl = { version = "1.0", features = [
"cargo",
"rustc",
], optional = true }

0 comments on commit aee15a7

Please sign in to comment.