Skip to content

Commit

Permalink
ci: check toml formatting with taplo-cli (#10787)
Browse files Browse the repository at this point in the history
* ci: check toml formatting with taplo-cli

* change name of job

* { workspace = true } -> .workspace = true

* add taplo.toml
  • Loading branch information
amrbashir committed Aug 27, 2024
1 parent ad83d41 commit 70306dc
Show file tree
Hide file tree
Showing 33 changed files with 433 additions and 441 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: check formatting

on:
pull_request:

jobs:
rustfmt:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: install Rust stable and rustfmt
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: run cargo fmt
run: cargo fmt --all -- --check

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- run: pnpm format:check

taplo:
name: taplo (.toml files)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: install taplo-cli
uses: taiki-e/install-action@v2
with:
tool: taplo-cli

- run: taplo fmt --check --diff
14 changes: 0 additions & 14 deletions .github/workflows/lint-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,6 @@ concurrency:
cancel-in-progress: true

jobs:
fmt:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: install Rust stable and rustfmt
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: run cargo fmt
run: cargo fmt --all -- --check

clippy:
runs-on: ubuntu-latest
strategy:
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ concurrency:
cancel-in-progress: true

jobs:
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- run: pnpm i --frozen-lockfile
- run: pnpm format:check

eslint:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
]
}
2 changes: 1 addition & 1 deletion core/tauri-acl-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[build-dependencies]
tauri-utils = { features = [ "schema" ], path = "../tauri-utils" }
tauri-utils = { features = ["schema"], path = "../tauri-utils" }
schemars = { version = "0.8", features = ["url", "preserve_order"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
38 changes: 19 additions & 19 deletions core/tauri-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
name = "tauri-build"
version = "2.0.0-rc.6"
description = "build time code to pair with https://crates.io/crates/tauri"
exclude = [ "CHANGELOG.md", "/target" ]
exclude = ["CHANGELOG.md", "/target"]
readme = "README.md"
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
categories = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
authors.workspace = true
homepage.workspace = true
repository.workspace = true
categories.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[package.metadata.docs.rs]
all-features = true
Expand All @@ -20,16 +20,16 @@ targets = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-linux-android",
"x86_64-apple-ios"
"x86_64-apple-ios",
]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
anyhow = "1"
quote = { version = "1", optional = true }
tauri-codegen = { version = "2.0.0-rc.6", path = "../tauri-codegen", optional = true }
tauri-utils = { version = "2.0.0-rc.6", path = "../tauri-utils", features = [ "build", "resources" ] }
tauri-utils = { version = "2.0.0-rc.6", path = "../tauri-utils", features = ["build", "resources"] }
cargo_toml = "0.17"
serde = "1"
serde_json = "1"
Expand All @@ -41,12 +41,12 @@ semver = "1"
dirs = "5"
glob = "0.3"
toml = "0.8"
schemars = { version = "0.8.18", features = [ "preserve_order" ] }
schemars = { version = "0.8.18", features = ["preserve_order"] }

[features]
default = [ "config-json" ]
codegen = [ "tauri-codegen", "quote" ]
isolation = [ "tauri-codegen/isolation", "tauri-utils/isolation" ]
config-json = [ ]
config-json5 = [ "tauri-utils/config-json5" ]
config-toml = [ "tauri-utils/config-toml" ]
default = ["config-json"]
codegen = ["tauri-codegen", "quote"]
isolation = ["tauri-codegen/isolation", "tauri-utils/isolation"]
config-json = []
config-json5 = ["tauri-utils/config-json5"]
config-toml = ["tauri-utils/config-toml"]
34 changes: 17 additions & 17 deletions core/tauri-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
name = "tauri-codegen"
version = "2.0.0-rc.6"
description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`"
exclude = [ "CHANGELOG.md", "/target" ]
exclude = ["CHANGELOG.md", "/target"]
readme = "README.md"
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
categories = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
authors.workspace = true
homepage.workspace = true
repository.workspace = true
categories.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[dependencies]
sha2 = "0.10"
base64 = "0.22"
proc-macro2 = "1"
quote = "1"
syn = "2"
serde = { version = "1", features = [ "derive" ] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-utils = { version = "2.0.0-rc.6", path = "../tauri-utils", features = [ "build" ] }
tauri-utils = { version = "2.0.0-rc.6", path = "../tauri-utils", features = ["build"] }
thiserror = "1"
walkdir = "2"
brotli = { version = "6", optional = true, default-features = false, features = [ "std" ] }
brotli = { version = "6", optional = true, default-features = false, features = ["std"] }
regex = { version = "1", optional = true }
uuid = { version = "1", features = [ "v4" ] }
uuid = { version = "1", features = ["v4"] }
semver = "1"
ico = "0.3"
png = "0.17"
Expand All @@ -34,10 +34,10 @@ url = "2"

[target."cfg(target_os = \"macos\")".dependencies]
plist = "1"
time = { version = "0.3", features = [ "parsing", "formatting" ] }
time = { version = "0.3", features = ["parsing", "formatting"] }

[features]
compression = [ "brotli", "tauri-utils/compression" ]
isolation = [ "tauri-utils/isolation" ]
config-json5 = [ "tauri-utils/config-json5" ]
config-toml = [ "tauri-utils/config-toml" ]
compression = ["brotli", "tauri-utils/compression"]
isolation = ["tauri-utils/isolation"]
config-json5 = ["tauri-utils/config-json5"]
config-toml = ["tauri-utils/config-toml"]
2 changes: 1 addition & 1 deletion core/tauri-config-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false

[build-dependencies]
tauri-utils = { features = [ "schema" ], path = "../tauri-utils" }
tauri-utils = { features = ["schema"], path = "../tauri-utils" }
schemars = { version = "0.8.18", features = ["url", "preserve_order"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
32 changes: 16 additions & 16 deletions core/tauri-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
name = "tauri-macros"
version = "2.0.0-rc.5"
description = "Macros for the tauri crate."
exclude = [ "CHANGELOG.md", "/target" ]
exclude = ["CHANGELOG.md", "/target"]
readme = "README.md"
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
categories = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
authors.workspace = true
homepage.workspace = true
repository.workspace = true
categories.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[lib]
proc-macro = true

[dependencies]
proc-macro2 = { version = "1", features = [ "span-locations" ] }
proc-macro2 = { version = "1", features = ["span-locations"] }
quote = "1"
syn = { version = "2", features = [ "full" ] }
syn = { version = "2", features = ["full"] }
heck = "0.5"
tauri-codegen = { version = "2.0.0-rc.6", default-features = false, path = "../tauri-codegen" }
tauri-utils = { version = "2.0.0-rc.6", path = "../tauri-utils" }

[features]
custom-protocol = [ ]
compression = [ "tauri-codegen/compression" ]
isolation = [ "tauri-codegen/isolation" ]
config-json5 = [ "tauri-codegen/config-json5", "tauri-utils/config-json5" ]
config-toml = [ "tauri-codegen/config-toml", "tauri-utils/config-toml" ]
tracing = [ ]
custom-protocol = []
compression = ["tauri-codegen/compression"]
isolation = ["tauri-codegen/isolation"]
config-json5 = ["tauri-codegen/config-json5", "tauri-utils/config-json5"]
config-toml = ["tauri-codegen/config-toml", "tauri-utils/config-toml"]
tracing = []
30 changes: 16 additions & 14 deletions core/tauri-plugin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
name = "tauri-plugin"
version = "2.0.0-rc.6"
description = "Build script and runtime Tauri plugin definitions"
authors = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }
categories = { workspace = true }
license = { workspace = true }
edition = { workspace = true }
rust-version = { workspace = true }
authors.workspace = true
homepage.workspace = true
repository.workspace = true
categories.workspace = true
license.workspace = true
edition.workspace = true
rust-version.workspace = true

[package.metadata.docs.rs]
features = [ "build", "runtime" ]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
features = ["build", "runtime"]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
build = [
Expand All @@ -23,18 +23,20 @@ build = [
"dep:glob",
"dep:toml",
"dep:plist",
"dep:walkdir"
"dep:walkdir",
]
runtime = [ ]
runtime = []

[dependencies]
anyhow = { version = "1", optional = true }
serde = { version = "1", optional = true }
tauri-utils = { version = "2.0.0-rc.6", default-features = false, features = [ "build" ], path = "../tauri-utils" }
tauri-utils = { version = "2.0.0-rc.6", default-features = false, features = [
"build",
], path = "../tauri-utils" }
serde_json = { version = "1", optional = true }
glob = { version = "0.3", optional = true }
toml = { version = "0.8", optional = true }
schemars = { version = "0.8.18", features = [ "preserve_order" ] }
schemars = { version = "0.8.18", features = ["preserve_order"] }
walkdir = { version = "2", optional = true }

[target."cfg(target_os = \"macos\")".dependencies]
Expand Down
Loading

0 comments on commit 70306dc

Please sign in to comment.