Skip to content

Commit

Permalink
[PM-16078] Add cargo sort (#80)
Browse files Browse the repository at this point in the history
Validate the cargo.toml is sorted correctly.
  • Loading branch information
Hinton authored Dec 16, 2024
1 parent 5fc933f commit c3053cd
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
with:
sarif_file: clippy_result.sarif

- name: Install cargo-sort
run: cargo install cargo-sort --locked --git https://github.com/DevinR528/cargo-sort.git --rev f5047967021cbb1f822faddc355b3b07674305a1

- name: Cargo sort
run: cargo sort --workspace --check

- name: Set up Node
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["crates/*", "bitwarden_license/*"]
members = ["bitwarden_license/*", "crates/*"]

# Global settings for all crates should be defined here
[workspace.package]
Expand Down
6 changes: 3 additions & 3 deletions crates/bitwarden-api-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ license-file.workspace = true
keywords.workspace = true

[dependencies]
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_repr = { workspace = true }
serde_with = { version = ">=3.8, <4", default-features = false, features = [
"base64",
"std",
"macros",
] }
serde_json = { workspace = true }
serde_repr = { workspace = true }
url = ">=2.5, <3"
uuid = { workspace = true }
reqwest = { workspace = true }
6 changes: 3 additions & 3 deletions crates/bitwarden-api-identity/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ license-file.workspace = true
keywords.workspace = true

[dependencies]
reqwest = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_repr = { workspace = true }
serde_with = { version = ">=3.8, <4", default-features = false, features = [
"base64",
"std",
"macros",
] }
serde_json = { workspace = true }
serde_repr = { workspace = true }
url = ">=2.5, <3"
uuid = { workspace = true }
reqwest = { workspace = true }
8 changes: 4 additions & 4 deletions crates/bitwarden-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ license-file.workspace = true
[features]
internal = ["dep:zxcvbn"]
no-memory-hardening = [
"bitwarden-crypto/no-memory-hardening",
"bitwarden-crypto/no-memory-hardening"
] # Disable memory hardening features
uniffi = ["bitwarden-crypto/uniffi", "dep:uniffi"] # Uniffi bindings
secrets = [] # Secrets manager API
wasm = [
"bitwarden-error/wasm",
"dep:wasm-bindgen",
"dep:tsify-next",
"dep:tsify-next"
] # WASM support

[dependencies]
base64 = ">=0.22.1, <0.23"
bitwarden-api-api = { workspace = true }
bitwarden-api-identity = { workspace = true }
bitwarden-crypto = { workspace = true }
bitwarden-error = { workspace = true }
chrono = { workspace = true, features = ["std"] }
# We don't use this directly (it's used by rand), but we need it here to enable WASM support
getrandom = { version = ">=0.2.9, <0.3", features = ["js"] }
Expand All @@ -46,14 +47,13 @@ serde_repr = { workspace = true }
sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
uniffi = { workspace = true, optional = true, features = ["tokio"] }
uuid = { workspace = true }
validator = { workspace = true }
wasm-bindgen = { workspace = true, optional = true }
zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] }
zxcvbn = { version = ">=3.0.1, <4.0", optional = true }
tsify-next = { workspace = true, optional = true }
bitwarden-error = { workspace = true }

[target.'cfg(not(target_arch="wasm32"))'.dependencies]
# By default, we use rustls as the TLS stack and rust-platform-verifier to support user-installed root certificates
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-error-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ proc-macro = true

[dev-dependencies]
bitwarden-error.workspace = true
js-sys.workspace = true
serde.workspace = true
thiserror.workspace = true
tsify-next.workspace = true
js-sys.workspace = true
wasm-bindgen.workspace = true
2 changes: 1 addition & 1 deletion crates/bitwarden-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ wasm = [
"bitwarden-error-macro/wasm",
"dep:js-sys",
"dep:tsify-next",
"dep:wasm-bindgen",
"dep:wasm-bindgen"
]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-send/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keywords.workspace = true
uniffi = [
"bitwarden-core/uniffi",
"bitwarden-crypto/uniffi",
"dep:uniffi",
"dep:uniffi"
] # Uniffi bindings

[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions crates/bitwarden-vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keywords.workspace = true
uniffi = [
"bitwarden-core/uniffi",
"bitwarden-crypto/uniffi",
"dep:uniffi",
"dep:uniffi"
] # Uniffi bindings
wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support

Expand All @@ -27,8 +27,8 @@ bitwarden-api-api = { workspace = true }
bitwarden-core = { workspace = true, features = ["internal"] }
bitwarden-crypto = { workspace = true }
chrono = { workspace = true }
rand = ">=0.8.5, <0.9"
hmac = ">=0.12.1, <0.13"
rand = ">=0.8.5, <0.9"
reqwest = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
Expand All @@ -37,9 +37,9 @@ serde_repr = { workspace = true }
sha1 = ">=0.10.5, <0.11"
sha2 = ">=0.10.6, <0.11"
thiserror = { workspace = true }
tsify-next = { workspace = true, optional = true }
uniffi = { version = "=0.28.3", optional = true }
uuid = { workspace = true }
tsify-next = { workspace = true, optional = true }
wasm-bindgen = { workspace = true, optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-wasm-internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ crate-type = ["cdylib"]
bitwarden-core = { workspace = true, features = ["wasm", "internal"] }
bitwarden-crypto = { workspace = true, features = ["wasm"] }
bitwarden-error = { version = "1.0.0", path = "../bitwarden-error" }
bitwarden-vault = { workspace = true, features = ["wasm"] }
bitwarden-ssh = { workspace = true, features = ["wasm"] }
bitwarden-vault = { workspace = true, features = ["wasm"] }
console_error_panic_hook = "0.1.7"
console_log = { version = "1.0.0", features = ["color"] }
js-sys = "0.3.68"
Expand Down

0 comments on commit c3053cd

Please sign in to comment.