Skip to content

Commit

Permalink
Merge pull request #2261 from CosmWasm/aw/taplo-toml
Browse files Browse the repository at this point in the history
Add `taplo` for TOML formatting
  • Loading branch information
aumetra authored Sep 23, 2024
2 parents 666312e + 87e0e60 commit 45b4629
Show file tree
Hide file tree
Showing 24 changed files with 181 additions and 58 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@ jobs:

# Get latest version from https://autofix.ci/setup
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a

autofix-toml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install taplo
run: |
curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \
| gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo
- run: |
taplo fmt
# Get latest version from https://autofix.ci/setup
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
26 changes: 26 additions & 0 deletions .github/workflows/toml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "TOML checks"

on:
merge_group:
pull_request:
push:
branches:
- main
workflow_dispatch:

jobs:
fmt-check:
name: "Formatting"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install taplo
run: |
curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \
| gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo
- run: |
taplo fmt
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
exit 1
fi
3 changes: 3 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[formatting]
indent_string = " "
reorder_arrays = true
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ version = "2.1.3"

[workspace.dependencies]
schemars = "0.8.4"
serde = { version = "1.0.192", default-features = false, features = ["derive", "alloc"] }
serde = { version = "1.0.192", default-features = false, features = [
"alloc",
"derive",
] }

[workspace.metadata.release]
shared-version = true
Expand Down
9 changes: 2 additions & 7 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
]
extend-ignore-re = ["(?Rm)^.*(#|//)\\s*spellchecker:disable-line$"]

[files]
extend-exclude = [
"contracts/**/schema/**",
"packages/crypto/**/*.json",
]
extend-exclude = ["contracts/**/schema/**", "packages/crypto/**/*.json"]
14 changes: 11 additions & 3 deletions contracts/burner/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "burner"
version = "0.0.0"
authors = ["Ethan Frey <[email protected]>", "Simon Warta <[email protected]>"]
authors = [
"Ethan Frey <[email protected]>",
"Simon Warta <[email protected]>",
]
edition = "2021"
publish = false
license = "Apache-2.0"
Expand Down Expand Up @@ -31,9 +34,14 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", features = ["iterator", "cosmwasm_1_4"] }
cosmwasm-std = { path = "../../packages/std", features = [
"cosmwasm_1_4",
"iterator",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
] }
14 changes: 11 additions & 3 deletions contracts/crypto-verify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,23 @@ cranelift = ["cosmwasm-vm/cranelift"]
[dependencies]
base64 = "0.22.0"
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", features = ["cosmwasm_2_1", "iterator"] }
cosmwasm-std = { path = "../../packages/std", features = [
"cosmwasm_2_1",
"iterator",
] }
hex = "0.4"
p256 = { version = "0.13.2", default-features = false, features = ["alloc", "ecdsa"] }
p256 = { version = "0.13.2", default-features = false, features = [
"alloc",
"ecdsa",
] }
rlp = "0.5"
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
sha2 = "0.10"
sha3 = "0.10"

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
] }
hex-literal = "0.4.1"
6 changes: 5 additions & 1 deletion contracts/cyberpunk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "abort", "cosmwasm_1_3"] }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = [
"abort",
"cosmwasm_1_3",
"std",
] }
rust-argon2 = "2.1"
thiserror = "1.0.26"

Expand Down
4 changes: 3 additions & 1 deletion contracts/empty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@ cosmwasm-std = { path = "../../packages/std", features = ["iterator"] }
schemars = "0.8.12"

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
] }
4 changes: 3 additions & 1 deletion contracts/floaty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"] }
rand_chacha = { version = "0.3.1", default-features = false }

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
] }
6 changes: 5 additions & 1 deletion contracts/hackatom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "abort", "cosmwasm_2_2"] }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = [
"abort",
"cosmwasm_2_2",
"std",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
sha2 = "0.10"
Expand Down
10 changes: 8 additions & 2 deletions contracts/ibc-callbacks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", features = ["iterator", "stargate"] }
cosmwasm-std = { path = "../../packages/std", features = [
"iterator",
"stargate",
] }
schemars = "0.8.3"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator", "stargate"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
"stargate",
] }
11 changes: 9 additions & 2 deletions contracts/ibc-reflect-send/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", features = ["iterator", "staking", "stargate"] }
cosmwasm-std = { path = "../../packages/std", features = [
"iterator",
"staking",
"stargate",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator", "stargate"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
"stargate",
] }
10 changes: 7 additions & 3 deletions contracts/ibc-reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", features = ["iterator", "stargate", "cosmwasm_2_2"] }
cosmwasm-std = { path = "../../packages/std", features = [
"cosmwasm_2_2",
"iterator",
"stargate",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
"stargate",
"iterator",
"stargate",
] }
14 changes: 11 additions & 3 deletions contracts/queue/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "queue"
version = "0.0.0"
authors = ["Simon Warta <[email protected]>", "Ethan Frey <[email protected]>"]
authors = [
"Ethan Frey <[email protected]>",
"Simon Warta <[email protected]>",
]
edition = "2021"
publish = false
license = "Apache-2.0"
Expand Down Expand Up @@ -33,9 +36,14 @@ library = []
[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
# cosmwasm_1_4 is enabled here for more efficient `range_keys` and `range_values`
cosmwasm-std = { path = "../../packages/std", features = ["iterator", "cosmwasm_1_4"] }
cosmwasm-std = { path = "../../packages/std", features = [
"cosmwasm_1_4",
"iterator",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
] }
11 changes: 9 additions & 2 deletions contracts/reflect/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "staking", "stargate", "cosmwasm_2_2"] }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = [
"cosmwasm_2_2",
"staking",
"stargate",
"std",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = "1.0.26"

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["stargate"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"stargate",
] }
9 changes: 7 additions & 2 deletions contracts/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ cranelift = ["cosmwasm-vm/cranelift"]

[dependencies]
cosmwasm-schema = { path = "../../packages/schema" }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = ["std", "staking"] }
cosmwasm-std = { path = "../../packages/std", default-features = false, features = [
"staking",
"std",
] }
schemars = "0.8.12"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
snafu = "0.8.2"

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["staking"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"staking",
] }
4 changes: 3 additions & 1 deletion contracts/virus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = "1.0.26"

[dev-dependencies]
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = ["iterator"] }
cosmwasm-vm = { path = "../../packages/vm", default-features = false, features = [
"iterator",
] }
6 changes: 3 additions & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ unlicensed = "deny"
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = [
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"CC0-1.0",
Expand Down Expand Up @@ -128,8 +128,8 @@ exceptions = [
# and the crate will be checked normally, which may produce warnings or errors
# depending on the rest of your configuration
#license-files = [
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
# Each entry is a crate relative path, and the (opaque) hash of its contents
#{ path = "LICENSE", hash = 0xbd0eed23 }
#]

[licenses.private]
Expand Down
7 changes: 5 additions & 2 deletions packages/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ark-ff = { version = "0.4.2", features = ["asm", "parallel"] }
ark-serialize = "0.4.2"
cosmwasm-core = { version = "2.1.3", path = "../core" }
digest = "0.10"
ecdsa = "0.16.2" # Not used directly, but needed to bump transitive dependency, see: https://github.com/CosmWasm/cosmwasm/pull/1899 for details.
ecdsa = "0.16.2" # Not used directly, but needed to bump transitive dependency, see: https://github.com/CosmWasm/cosmwasm/pull/1899 for details.
ed25519-zebra = { version = "4.0.3", default-features = false }
k256 = { version = "0.13.3", default-features = false, features = ["ecdsa"] }
num-traits = "0.2.18"
Expand All @@ -36,7 +36,10 @@ base64 = "0.22.0"
base64-serde = "0.7.0"
criterion = "0.5.1"
rand_core = { version = "0.6", features = ["getrandom"] }
serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] }
serde = { version = "1.0.103", default-features = false, features = [
"alloc",
"derive",
] }
serde_json = "1.0.40"
sha2 = "0.10"
sha3 = "0.10"
Expand Down
6 changes: 3 additions & 3 deletions packages/go-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ release = false

[dependencies]
cosmwasm-std = { version = "2.1.3", path = "../std", features = [
"cosmwasm_2_2",
"staking",
"stargate",
"cosmwasm_2_2",
"staking",
"stargate",
] }
cosmwasm-schema = { version = "2.1.3", path = "../schema" }
anyhow = "1"
Expand Down
5 changes: 4 additions & 1 deletion packages/schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "cosmwasm-schema"
version.workspace = true
authors = ["Simon Warta <[email protected]>", "Ethan Frey <[email protected]>"]
authors = [
"Ethan Frey <[email protected]>",
"Simon Warta <[email protected]>",
]
edition = "2021"
description = "A dev-dependency for CosmWasm contracts to generate JSON Schema files."
repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema"
Expand Down
Loading

0 comments on commit 45b4629

Please sign in to comment.