ci: check toml formatting with taplo-cli (#10787)

* ci: check toml formatting with taplo-cli

* change name of job

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

* add taplo.toml
This commit is contained in:
Amr Bashir
2024-08-27 03:46:05 +03:00
committed by GitHub
parent ad83d41cb5
commit 70306dc79b
33 changed files with 433 additions and 441 deletions

51
.github/workflows/fmt.yml vendored Normal file
View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -1,7 +1,8 @@
{
"recommendations": [
"rust-lang.rust-analyzer",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
]
}

View File

@@ -4,13 +4,13 @@ version = "2.0.0-rc.6"
description = "build time code to pair with https://crates.io/crates/tauri"
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
@@ -20,7 +20,7 @@ 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"]

View File

@@ -4,13 +4,13 @@ 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"]
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"

View File

@@ -4,13 +4,13 @@ version = "2.0.0-rc.5"
description = "Macros for the tauri crate."
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

View File

@@ -2,13 +2,13 @@
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"]
@@ -23,14 +23,16 @@ build = [
"dep:glob",
"dep:toml",
"dep:plist",
"dep:walkdir"
"dep:walkdir",
]
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 }

View File

@@ -4,20 +4,24 @@ version = "2.0.0-rc.6"
description = "Wry bindings to the Tauri runtime"
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]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
wry = { version = "0.42", default-features = false, features = [ "drag-drop", "protocol", "os-webview" ] }
wry = { version = "0.42", default-features = false, features = [
"drag-drop",
"protocol",
"os-webview",
] }
tao = { version = "0.29.1", default-features = false, features = ["rwh_06"] }
tauri-runtime = { version = "2.0.0-rc.6", path = "../tauri-runtime" }
tauri-utils = { version = "2.0.0-rc.6", path = "../tauri-utils" }
@@ -48,11 +52,7 @@ jni = "0.21"
[features]
devtools = ["wry/devtools", "tauri-runtime/devtools"]
macos-private-api = [
"wry/fullscreen",
"wry/transparent",
"tauri-runtime/macos-private-api"
]
macos-private-api = ["wry/fullscreen", "wry/transparent", "tauri-runtime/macos-private-api"]
objc-exception = ["wry/objc-exception"]
linux-protocol-body = ["wry/linux-body", "webkit2gtk/v2_40"]
tracing = ["dep:tracing", "wry/tracing"]

View File

@@ -4,13 +4,13 @@ version = "2.0.0-rc.6"
description = "Runtime for Tauri applications"
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
@@ -22,7 +22,7 @@ targets = [
"x86_64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-linux-android",
"x86_64-apple-ios"
"x86_64-apple-ios",
]
[dependencies]

View File

@@ -4,13 +4,13 @@ version = "2.0.0-rc.6"
description = "Utilities for Tauri"
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]
serde = { version = "1", features = ["derive"] }
@@ -52,13 +52,7 @@ getrandom = { version = "0.2", features = [ "std" ] }
serial_test = "3.1"
[features]
build = [
"proc-macro2",
"quote",
"cargo_metadata",
"schema",
"swift-rs"
]
build = ["proc-macro2", "quote", "cargo_metadata", "schema", "swift-rs"]
compression = ["brotli"]
schema = ["schemars"]
isolation = ["aes-gcm", "getrandom", "serialize-to-javascript"]

View File

@@ -5,13 +5,13 @@ description = "Make tiny, secure apps for all desktop platforms with Tauri"
exclude = ["/test", "/.scripts", "CHANGELOG.md", "/target"]
readme = "README.md"
links = "Tauri"
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]
no-default-features = true
@@ -45,13 +45,7 @@ development = ["quickcheck_macros"]
[dependencies]
serde_json = { version = "1.0", features = ["raw_value"] }
serde = { version = "1.0", features = ["derive", "rc"] }
tokio = { version = "1", features = [
"rt",
"rt-multi-thread",
"sync",
"fs",
"io-util",
] }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync", "fs", "io-util"] }
futures-util = "0.3"
uuid = { version = "1", features = ["v4"], optional = true }
url = "2"
@@ -67,10 +61,7 @@ state = "0.6"
http = "1.1"
dirs = "5"
percent-encoding = "2.3"
reqwest = { version = "0.12", default-features = false, features = [
"json",
"stream",
] }
reqwest = { version = "0.12", default-features = false, features = ["json", "stream"] }
bytes = { version = "1", features = ["serde"] }
raw-window-handle = { version = "0.6", features = ["std"] }
glob = "0.3"
@@ -91,9 +82,7 @@ specta = { version = "^2.0.0-rc.16", optional = true, default-features = false,
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\", target_os = \"windows\", target_os = \"macos\"))".dependencies]
muda = { version = "0.14", default-features = false, features = ["serde"] }
tray-icon = { version = "0.15", default-features = false, features = [
"serde",
], optional = true }
tray-icon = { version = "0.15", default-features = false, features = ["serde"], optional = true }
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
gtk = { version = "0.18", features = ["v3_24"] }
@@ -141,20 +130,14 @@ http-range = "0.1.5"
[features]
default = ["wry", "compression", "objc-exception", "common-controls-v6"]
unstable = ["tauri-runtime-wry/unstable"]
common-controls-v6 = [
"tray-icon?/common-controls-v6",
"muda/common-controls-v6",
]
common-controls-v6 = ["tray-icon?/common-controls-v6", "muda/common-controls-v6"]
tray-icon = ["dep:tray-icon"]
tracing = ["dep:tracing", "tauri-macros/tracing", "tauri-runtime-wry/tracing"]
test = []
compression = ["tauri-macros/compression", "tauri-utils/compression"]
wry = ["tauri-runtime-wry"]
objc-exception = ["tauri-runtime-wry/objc-exception"]
linux-ipc-protocol = [
"tauri-runtime-wry/linux-protocol-body",
"webkit2gtk/v2_40",
]
linux-ipc-protocol = ["tauri-runtime-wry/linux-protocol-body", "webkit2gtk/v2_40"]
linux-libxdo = ["tray-icon/libxdo", "muda/libxdo"]
isolation = ["tauri-utils/isolation", "tauri-macros/isolation", "uuid"]
custom-protocol = ["tauri-macros/custom-protocol"]
@@ -165,10 +148,7 @@ devtools = ["tauri-runtime/devtools", "tauri-runtime-wry/devtools"]
process-relaunch-dangerous-allow-symlink-macos = [
"tauri-utils/process-relaunch-dangerous-allow-symlink-macos",
]
macos-private-api = [
"tauri-runtime/macos-private-api",
"tauri-runtime-wry/macos-private-api",
]
macos-private-api = ["tauri-runtime/macos-private-api", "tauri-runtime-wry/macos-private-api"]
webview-data-url = ["data-url"]
protocol-asset = ["http-range"]
config-json5 = ["tauri-macros/config-json5"]

View File

@@ -1,7 +1,4 @@
identifier = "run-app-external-url"
description = "external window capability"
windows = ["external"]
permissions = [
"fs:read",
"fs:deny-home"
]
permissions = ["fs:read", "fs:deny-home"]

View File

@@ -7,5 +7,5 @@ permissions = [
"fs:deny-home",
"fs:allow-read-resources",
"fs:allow-move-temp",
"fs:read-download-dir"
"fs:read-download-dir",
]

View File

@@ -4,7 +4,6 @@ description = "Allows accessing the $APP path."
[[permission.scope.allow]]
path = "$APP"
[[permission]]
identifier = "allow-download-dir"
description = "Allows accessing the $DOWNLOAD directory."

View File

@@ -11,10 +11,7 @@ name = "api_lib"
crate-type = ["staticlib", "cdylib", "lib"]
[build-dependencies]
tauri-build = { path = "../../../core/tauri-build", features = [
"codegen",
"isolation",
] }
tauri-build = { path = "../../../core/tauri-build", features = ["codegen", "isolation"] }
[dependencies]
serde_json = "1.0"

3
taplo.toml Normal file
View File

@@ -0,0 +1,3 @@
[formatting]
allowed_blank_lines = 1
column_width = 100

View File

@@ -1,7 +1,5 @@
[workspace]
members = [
"./*/src-tauri/",
]
members = ["./*/src-tauri/"]
resolver = "2"
[profile.release]

View File

@@ -3,10 +3,7 @@ workspace = { }
[package]
name = "tauri-bundler"
version = "2.0.1-rc.5"
authors = [
"George Burton <burtonageo@gmail.com>",
"Tauri Programme within The Commons Conservancy"
]
authors = ["George Burton <burtonageo@gmail.com>", "Tauri Programme within The Commons Conservancy"]
categories = ["command-line-utilities", "development-tools::cargo-plugins"]
license = "Apache-2.0 OR MIT"
keywords = ["bundle", "cargo", "tauri"]
@@ -49,10 +46,7 @@ glob = "0.3"
[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
version = "0.59"
features = [
"Win32_System_SystemInformation",
"Win32_System_Diagnostics_Debug"
]
features = ["Win32_System_SystemInformation", "Win32_System_Diagnostics_Debug"]
[target."cfg(target_os = \"macos\")".dependencies]
icns = { package = "tauri-icns", version = "0.1" }

View File

@@ -20,7 +20,7 @@ include = [
"*.rs",
"tauri.gitignore",
"tauri-dev-watcher.gitignore",
"LICENSE*"
"LICENSE*",
]
[package.metadata.binstall]
@@ -58,8 +58,18 @@ shared_child = "1.0"
duct = "0.13"
toml_edit = { version = "0.22", features = ["serde"] }
json-patch = "2.0"
tauri-utils = { version = "2.0.0-rc.6", path = "../../core/tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [ "isolation", "schema", "config-json5", "config-toml" ] }
tauri-utils = { version = "2.0.0-rc.6", path = "../../core/tauri-utils", features = [
"isolation",
"schema",
"config-json5",
"config-toml",
] }
tauri-utils-v1 = { version = "1", package = "tauri-utils", features = [
"isolation",
"schema",
"config-json5",
"config-toml",
] }
toml = "0.8"
jsonschema = "0.18"
handlebars = "6.0"
@@ -108,11 +118,7 @@ insta = "1"
[target."cfg(windows)".dependencies.windows-sys]
version = "0.59"
features = [
"Win32_Storage_FileSystem",
"Win32_System_IO",
"Win32_System_Console"
]
features = ["Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_Console"]
[target."cfg(unix)".dependencies]
libc = "0.2"
@@ -123,11 +129,7 @@ tauri-macos-sign = { version = "0.1.1-rc.0", path = "../macos-sign" }
[features]
default = ["rustls"]
native-tls = [
"tauri-bundler/native-tls",
"cargo-mobile2/native-tls",
"ureq/native-tls"
]
native-tls = ["tauri-bundler/native-tls", "cargo-mobile2/native-tls", "ureq/native-tls"]
native-tls-vendored = ["native-tls", "tauri-bundler/native-tls-vendored"]
rustls = ["tauri-bundler/rustls", "cargo-mobile2/rustls", "ureq/tls"]