From 18c9fc2cc1a0006dc3dfb7477b239bd0d5dee182 Mon Sep 17 00:00:00 2001 From: Will Binns-Smith Date: Wed, 30 Nov 2022 19:05:07 -0800 Subject: [PATCH] Run taplo format and check consistency in CI (#2866) * Add GitHub action step for taplo --check * Run taplo format --- .github/workflows/test.yml | 3 + .taplo.toml | 1 - Cargo.toml | 2 +- crates/next-binding/Cargo.toml | 65 +++++++-------------- crates/next-dev/Cargo.toml | 5 +- crates/turbo-tasks-build/Cargo.toml | 6 +- crates/turbo-tasks-macros-shared/Cargo.toml | 6 +- crates/turbo-tasks-macros/Cargo.toml | 6 +- crates/turbopack-ecmascript/Cargo.toml | 10 ++-- crates/turbopack/Cargo.toml | 4 +- 10 files changed, 44 insertions(+), 64 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c03b0df06628..a47bf34c1f345 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -387,6 +387,9 @@ jobs: fi fi + - name: Check Cargo.toml formatting (taplo) + run: npx @taplo/cli format --check + - name: Check licenses uses: EmbarkStudios/cargo-deny-action@v1 with: diff --git a/.taplo.toml b/.taplo.toml index 77f72ebe3e6cc..10e021524cbf9 100644 --- a/.taplo.toml +++ b/.taplo.toml @@ -5,5 +5,4 @@ keys = ["dependencies", "*-dependencies"] [rule.formatting] reorder_keys = true -align_entries = true indent_tables = true diff --git a/Cargo.toml b/Cargo.toml index 1444b827bfa40..104eb4957dc97 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ opt-level = 3 # This version pin is workaround for https://github.com/tkaitchuck/aHash/issues/95 indexmap = { version = "=1.6.2" } swc_core = { version = "0.43.23" } -testing = {version = "0.31.14"} +testing = { version = "0.31.14" } swc_emotion = { version = "0.28.1" } styled_jsx = { version = "0.29.1" } styled_components = { version = "0.52.1" } diff --git a/crates/next-binding/Cargo.toml b/crates/next-binding/Cargo.toml index 9f0c206c79227..20a5beebb5b42 100644 --- a/crates/next-binding/Cargo.toml +++ b/crates/next-binding/Cargo.toml @@ -10,9 +10,7 @@ bench = false [features] __swc = [] -__swc_core = [ - "__swc", -] +__swc_core = ["__swc"] __swc_core_next_core = [ "__swc_core", "swc_core/common_concurrent", @@ -29,7 +27,7 @@ __swc_core_next_core = [ "swc_core/ecma_parser", "swc_core/ecma_parser_typescript", "swc_core/cached", - "swc_core/base" + "swc_core/base", ] __swc_core_binding_napi = [ @@ -54,9 +52,7 @@ __swc_core_binding_napi = [ "swc_core/ecma_utils", "swc_core/ecma_visit", ] -__swc_core_binding_napi_plugin = [ - "swc_core/plugin_transform_host_native" -] +__swc_core_binding_napi_plugin = ["swc_core/plugin_transform_host_native"] __swc_core_binding_wasm = [ "__swc_core", @@ -71,62 +67,41 @@ __swc_core_binding_wasm = [ "swc_core/ecma_parser", "swc_core/ecma_parser_typescript", "swc_core/ecma_utils", - "swc_core/ecma_visit" -] -__swc_core_binding_wasm_plugin = [ - "swc_core/plugin_transform_host_js" + "swc_core/ecma_visit", ] +__swc_core_binding_wasm_plugin = ["swc_core/plugin_transform_host_js"] -__swc_core_testing_transform = [ - "swc_core/testing_transform" -] +__swc_core_testing_transform = ["swc_core/testing_transform"] __turbo = [] -__feature_next_dev_server = [ - "__turbo", - "next-dev/serializable" -] -__feature_node_file_trace = [ - "__turbo", - "node-file-trace/node-api" -] +__feature_next_dev_server = ["__turbo", "next-dev/serializable"] +__feature_node_file_trace = ["__turbo", "node-file-trace/node-api"] __features = [] -__feature_mdx_rs = [ "__features", "mdxjs/serializable"] +__feature_mdx_rs = ["__features", "mdxjs/serializable"] __swc_custom_transform = [] __swc_transform_styled_components = [ "__swc", "__swc_custom_transform", - "styled_components" -] -__swc_transform_styled_jsx = [ - "__swc", - "__swc_custom_transform", - "styled_jsx" -] -__swc_transform_emotion = [ - "__swc", - "__swc_custom_transform", - "swc_emotion" + "styled_components", ] +__swc_transform_styled_jsx = ["__swc", "__swc_custom_transform", "styled_jsx"] +__swc_transform_emotion = ["__swc", "__swc_custom_transform", "swc_emotion"] __swc_transform_modularize_imports = [ "__swc", "__swc_custom_transform", - "modularize_imports" -] -__swc_testing = [ - "__swc", - "testing" + "modularize_imports", ] +__swc_testing = ["__swc", "testing"] [dependencies] -swc_core = { optional = true, workspace = true } mdxjs = { optional = true, workspace = true } +modularize_imports = { optional = true, workspace = true } next-dev = { optional = true, workspace = true } node-file-trace = { optional = true, workspace = true } -styled_components = { optional = true,workspace = true } -styled_jsx = { optional = true,workspace = true} -swc_emotion = { optional = true,workspace = true} -testing = {optional = true, workspace = true} -modularize_imports = { optional = true,workspace = true} \ No newline at end of file +styled_components = { optional = true, workspace = true } +styled_jsx = { optional = true, workspace = true } +swc_core = { optional = true, workspace = true } +swc_emotion = { optional = true, workspace = true } +testing = { optional = true, workspace = true } diff --git a/crates/next-dev/Cargo.toml b/crates/next-dev/Cargo.toml index 9217d1f1a7002..29d95a60d627e 100644 --- a/crates/next-dev/Cargo.toml +++ b/crates/next-dev/Cargo.toml @@ -76,4 +76,7 @@ nix = "0.25.0" [build-dependencies] turbo-tasks-build = { path = "../turbo-tasks-build" } -vergen = { version = "7.3.2", default-features = false, features = ["cargo", "build"] } \ No newline at end of file +vergen = { version = "7.3.2", default-features = false, features = [ + "cargo", + "build", +] } diff --git a/crates/turbo-tasks-build/Cargo.toml b/crates/turbo-tasks-build/Cargo.toml index 946d5a7474c41..028ff385e2ff6 100644 --- a/crates/turbo-tasks-build/Cargo.toml +++ b/crates/turbo-tasks-build/Cargo.toml @@ -18,6 +18,6 @@ serde = "1.0.136" toml = "0.5" turbo-tasks-macros-shared = { path = "../turbo-tasks-macros-shared" } -[dependencies.syn] -features = ["full"] -version = "1.0" + [dependencies.syn] + features = ["full"] + version = "1.0" diff --git a/crates/turbo-tasks-macros-shared/Cargo.toml b/crates/turbo-tasks-macros-shared/Cargo.toml index 46b7b2ace8b00..4f9fafcd701bb 100644 --- a/crates/turbo-tasks-macros-shared/Cargo.toml +++ b/crates/turbo-tasks-macros-shared/Cargo.toml @@ -13,6 +13,6 @@ proc-macro-error = "1.0.4" proc-macro2 = "1.0.36" quote = "1.0" -[dependencies.syn] -features = ["full"] -version = "1.0" + [dependencies.syn] + features = ["full"] + version = "1.0" diff --git a/crates/turbo-tasks-macros/Cargo.toml b/crates/turbo-tasks-macros/Cargo.toml index 5357e382d421d..92adaf1aecfa6 100644 --- a/crates/turbo-tasks-macros/Cargo.toml +++ b/crates/turbo-tasks-macros/Cargo.toml @@ -18,6 +18,6 @@ proc-macro2 = "1.0.36" quote = "1.0" turbo-tasks-macros-shared = { path = "../turbo-tasks-macros-shared" } -[dependencies.syn] -features = ["full", "extra-traits"] -version = "1.0" + [dependencies.syn] + features = ["full", "extra-traits"] + version = "1.0" diff --git a/crates/turbopack-ecmascript/Cargo.toml b/crates/turbopack-ecmascript/Cargo.toml index b2177e8be9771..2e08c2d9a7540 100644 --- a/crates/turbopack-ecmascript/Cargo.toml +++ b/crates/turbopack-ecmascript/Cargo.toml @@ -23,9 +23,9 @@ regex = "1.5.4" serde = "1.0.136" serde_json = "1.0.85" serde_regex = "1.1.0" -styled_components = {workspace = true } -styled_jsx = {workspace = true} -swc_emotion = {workspace = true} +styled_components = { workspace = true } +styled_jsx = { workspace = true } +swc_emotion = { workspace = true } tokio = "1.21.2" tracing = "0.1.37" turbo-tasks = { path = "../turbo-tasks" } @@ -55,8 +55,8 @@ swc_core = { workspace = true, features = [ "base", ] } -[dependencies.num-bigint] -version = "0.4" + [dependencies.num-bigint] + version = "0.4" [dev-dependencies] criterion = { version = "0.3.5", features = ["async_tokio"] } diff --git a/crates/turbopack/Cargo.toml b/crates/turbopack/Cargo.toml index 46339ba529687..d7eec53dc8e04 100644 --- a/crates/turbopack/Cargo.toml +++ b/crates/turbopack/Cargo.toml @@ -43,8 +43,8 @@ swc_core = { workspace = true, features = [ "ecma_visit", ] } -[dependencies.num-bigint] -version = "0.4" + [dependencies.num-bigint] + version = "0.4" [dev-dependencies] criterion = { version = "0.3.5", features = ["async_tokio"] }