Skip to content

Commit

Permalink
Use Taplo for TOML formatting (#4071)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Aug 12, 2024
1 parent 343af0e commit f4176da
Show file tree
Hide file tree
Showing 65 changed files with 342 additions and 382 deletions.
18 changes: 9 additions & 9 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'

[target.'cfg(all())']
rustflags = [
"-Adead_code",
"-Anon_upper_case_globals",
"-Aunused_doc_comments",
"-Aclippy::large_enum_variant",
"-Aclippy::missing_safety_doc",
"-Aclippy::new_without_default",
"-Aclippy::overly_complex_bool_expr",
"-Aclippy::too_many_arguments",
"-Aclippy::type_complexity"
"-Adead_code",
"-Anon_upper_case_globals",
"-Aunused_doc_comments",
"-Aclippy::large_enum_variant",
"-Aclippy::missing_safety_doc",
"-Aclippy::new_without_default",
"-Aclippy::overly_complex_bool_expr",
"-Aclippy::too_many_arguments",
"-Aclippy::type_complexity",
]
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ jobs:
- run: rustup update --no-self-update stable && rustup default stable
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check

# Check TOML style by using Taplo.
taplo:
name: Taplo

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@v2
with:
tool: taplo-cli
- run: taplo fmt --check

# Run `cargo check` over everything
check:
Expand Down
40 changes: 18 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
name = "wasm-bindgen"
version = "0.2.92"
authors = ["The wasm-bindgen Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
categories = ["wasm"]
repository = "https://github.com/rustwasm/wasm-bindgen"
homepage = "https://rustwasm.github.io/"
documentation = "https://docs.rs/wasm-bindgen"
description = """
Easy support for interacting between JS and Rust.
"""
documentation = "https://docs.rs/wasm-bindgen"
edition = "2021"
rust-version = "1.57"
homepage = "https://rustwasm.github.io/"
include = ["/build.rs", "/LICENSE-*", "/src"]
license = "MIT OR Apache-2.0"
name = "wasm-bindgen"
readme = "README.md"
repository = "https://github.com/rustwasm/wasm-bindgen"
rust-version = "1.57"
version = "0.2.92"

[package.metadata.docs.rs]
features = ["serde-serialize"]
Expand All @@ -23,10 +23,10 @@ test = false

[features]
default = ["spans", "std"]
enable-interning = ["std"]
serde-serialize = ["serde", "serde_json", "std"]
spans = ["wasm-bindgen-macro/spans"]
std = []
serde-serialize = ["serde", "serde_json", "std"]
enable-interning = ["std"]

# Whether or not the `#[wasm_bindgen]` macro is strict and generates an error on
# all unused attributes
Expand All @@ -38,31 +38,28 @@ gg-alloc = ["wasm-bindgen-test/gg-alloc"]

# This is only for debugging wasm-bindgen! No stability guarantees, so enable
# this at your own peril!
xxx_debug_only_print_generated_code = [
"wasm-bindgen-macro/xxx_debug_only_print_generated_code",
]
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]

[dependencies]
cfg-if = "1.0.0"
once_cell = "1.12"
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.92" }
serde = { version = "1.0", optional = true }
serde_json = { version = "1.0", optional = true }
cfg-if = "1.0.0"
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.92" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
js-sys = { path = 'crates/js-sys' }
wasm-bindgen-test = { path = 'crates/test' }
wasm-bindgen-futures = { path = 'crates/futures' }
serde_derive = "1.0"
wasm-bindgen-futures = { path = 'crates/futures' }
wasm-bindgen-test = { path = 'crates/test' }
wasm-bindgen-test-crate-a = { path = 'tests/crates/a' }
wasm-bindgen-test-crate-b = { path = 'tests/crates/b' }

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(wasm_bindgen_unstable_test_coverage)',
] }
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(wasm_bindgen_unstable_test_coverage)'] }

[workspace]
exclude = ["crates/msrv"]
members = [
"benchmarks",
"crates/cli",
Expand Down Expand Up @@ -108,11 +105,10 @@ members = [
"examples/synchronous-instantiation",
"tests/no-std",
]
exclude = ["crates/msrv"]
resolver = "2"

[patch.crates-io]
js-sys = { path = 'crates/js-sys' }
wasm-bindgen = { path = '.' }
wasm-bindgen-futures = { path = 'crates/futures' }
js-sys = { path = 'crates/js-sys' }
web-sys = { path = 'crates/web-sys' }
6 changes: 3 additions & 3 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "wasm-bindgen-benchmark"
version = "0.0.0"
authors = ["The wasm-bindgen Developers"]
edition = "2021"
name = "wasm-bindgen-benchmark"
publish = false
version = "0.0.0"

[dependencies]
js-sys = { path = '../crates/js-sys' }
wasm-bindgen = { path = '../' }
web-sys = { path = '../crates/web-sys', features = ['Node'] }
js-sys = { path = '../crates/js-sys' }

[lib]
crate-type = ['cdylib']
16 changes: 8 additions & 8 deletions crates/backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "wasm-bindgen-backend"
version = "0.2.92"
authors = ["The wasm-bindgen Developers"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://docs.rs/wasm-bindgen-backend"
description = """
Backend code generation of the wasm-bindgen tool
"""
documentation = "https://docs.rs/wasm-bindgen-backend"
edition = "2021"
rust-version = "1.57"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
include = ["/LICENSE-*", "/src"]
license = "MIT OR Apache-2.0"
name = "wasm-bindgen-backend"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
rust-version = "1.57"
version = "0.2.92"

[features]
spans = []
extra-traits = ["syn/extra-traits"]
spans = []

[dependencies]
bumpalo = "3.0.0"
Expand Down
16 changes: 8 additions & 8 deletions crates/cli-support/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "wasm-bindgen-cli-support"
version = "0.2.92"
authors = ["The wasm-bindgen Developers"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://docs.rs/wasm-bindgen-cli-support"
description = """
Shared support for the wasm-bindgen-cli package, an internal dependency
"""
documentation = "https://docs.rs/wasm-bindgen-cli-support"
edition = "2021"
rust-version = "1.76"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
include = ["/LICENSE-*", "/src"]
license = "MIT OR Apache-2.0"
name = "wasm-bindgen-cli-support"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support"
rust-version = "1.76"
version = "0.2.92"

[dependencies]
anyhow = "1.0"
Expand All @@ -20,11 +20,11 @@ log = "0.4"
rustc-demangle = "0.1.13"
serde_json = "1.0"
tempfile = "3.0"
unicode-ident = "1.0.5"
walrus = "0.21"
wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.92' }
wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.92' }
wasm-bindgen-shared = { path = "../shared", version = '=0.2.92' }
wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.92' }
wasm-bindgen-wasm-conventions = { path = '../wasm-conventions', version = '=0.2.92' }
wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.92' }
unicode-ident = "1.0.5"
27 changes: 12 additions & 15 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
[package]
name = "wasm-bindgen-cli"
version = "0.2.92"
authors = ["The wasm-bindgen Developers"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://rustwasm.github.io/wasm-bindgen/"
categories = ["wasm"]
default-run = 'wasm-bindgen'
description = """
Command line interface of the `#[wasm_bindgen]` attribute and project. For more
information see https://github.com/rustwasm/wasm-bindgen.
"""
documentation = "https://rustwasm.github.io/wasm-bindgen/"
edition = "2021"
default-run = 'wasm-bindgen'
rust-version = "1.76"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
include = ["/LICENSE-*", "/src"]
license = "MIT OR Apache-2.0"
name = "wasm-bindgen-cli"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli"
rust-version = "1.76"
version = "0.2.92"

[package.metadata.binstall]
pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version }/wasm-bindgen-{ version }-{ target }{ archive-suffix }"
bin-dir = "wasm-bindgen-{ version }-{ target }/{ bin }{ binary-ext }"
pkg-url = "https://github.com/rustwasm/wasm-bindgen/releases/download/{ version }/wasm-bindgen-{ version }-{ target }{ archive-suffix }"

[dependencies]
anyhow = "1.0"
docopt = "1.0"
env_logger = "0.11.5"
anyhow = "1.0"
log = "0.4"
native-tls = { version = "0.2", default-features = false, optional = true }
rouille = { version = "3.0.0", default-features = false }
serde = { version = "1.0", features = ['derive'] }
serde_derive = "1.0"
serde_json = "1.0"
ureq = { version = "2.7", default-features = false, features = [
"brotli",
"gzip",
] }
ureq = { version = "2.7", default-features = false, features = ["brotli", "gzip"] }
walrus = { version = "0.21", features = ['parallel'] }
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.92" }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.92" }
Expand All @@ -48,8 +45,8 @@ wasmparser = "0.212"
wasmprinter = "0.212"

[[test]]
name = "reference"
harness = false
name = "reference"

[features]
default = ["rustls-tls"]
Expand Down
13 changes: 4 additions & 9 deletions crates/example-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
[package]
name = "example-tests"
version = "0.0.0"
authors = ["The wasm-bindgen Developers"]
edition = "2021"
name = "example-tests"
publish = false
version = "0.0.0"

[features]
default = ["stable"]
stable = []
nightly = []
stable = []

[dependencies]
anyhow = "1.0.75"
futures-util = { version = "0.3.28", features = ["sink"] }
http = "1"
hyper = "1"
hyper-util = { version = "0.1.6", features = [
"http1",
"service",
"server",
"tokio",
] }
hyper-util = { version = "0.1.6", features = ["http1", "service", "server", "tokio"] }
mozprofile = "0.9"
mozrunner = "0.15"
serde = { version = "1.0", features = ["derive"] }
Expand Down
16 changes: 8 additions & 8 deletions crates/externref-xform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "wasm-bindgen-externref-xform"
version = "0.2.92"
authors = ["The wasm-bindgen Developers"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/externref-xform"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://docs.rs/wasm-bindgen-externref-xform"
description = """
Internal externref transformations for wasm-bindgen
"""
documentation = "https://docs.rs/wasm-bindgen-externref-xform"
edition = "2021"
rust-version = "1.76"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
include = ["/LICENSE-*", "/src"]
license = "MIT OR Apache-2.0"
name = "wasm-bindgen-externref-xform"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/externref-xform"
rust-version = "1.76"
version = "0.2.92"

[dependencies]
anyhow = "1.0"
Expand All @@ -25,5 +25,5 @@ wast = "212"
wat = "1.0"

[[test]]
name = "all"
harness = false
name = "all"
17 changes: 7 additions & 10 deletions crates/futures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,35 @@
authors = ["The wasm-bindgen Developers"]
description = "Bridging the gap between Rust Futures and JavaScript Promises"
documentation = "https://docs.rs/wasm-bindgen-futures"
edition = "2021"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
include = ["/LICENSE-*", "/src"]
license = "MIT OR Apache-2.0"
name = "wasm-bindgen-futures"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures"
readme = "./README.md"
version = "0.4.42"
edition = "2021"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures"
rust-version = "1.57"
include = ["/LICENSE-*", "/src"]
version = "0.4.42"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
cfg-if = "1.0.0"
futures-core = { version = '0.3.8', default-features = false, optional = true }
js-sys = { path = "../js-sys", version = '0.3.69' }
wasm-bindgen = { path = "../..", version = '0.2.92' }
futures-core = { version = '0.3.8', default-features = false, optional = true }

[features]
futures-core-03-stream = ['futures-core']

[target.'cfg(target_feature = "atomics")'.dependencies.web-sys]
features = ["MessageEvent", "Worker"]
path = "../web-sys"
version = "0.3.24"
features = [
"MessageEvent",
"Worker",
]

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = { path = '../test' }
futures-channel-preview = { version = "0.3.0-alpha.18" }
futures-lite = { version = "1.11.3", default-features = false }
wasm-bindgen-test = { path = '../test' }
Loading

0 comments on commit f4176da

Please sign in to comment.