Skip to content

Commit fd11c49

Browse files
authored
[PM-29535] Update cargo-sort (#602)
## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-29535 ## 📔 Objective Upgrades the version of cargo-sort used to the latest. This changes slightly the ordering and formatting of some of the Cargo.toml files, but they should be functionally identical. The change should help reduce the ammount of accidental changes made by devs when they install a too new version of cargo-sort. If you're running cargo-sort locally, make sure it's updated and that you're running the correct command (Now it needs a `--grouped` parameter). I'll post this on the SDK channel as well once the change is merged: ```sh # To install it cargo install cargo-sort --version 2.0.2 --locked # To sort and format the cargo manifests cargo sort --workspace --grouped # To check if the files are sorted correctly, without making any changes cargo sort --workspace --grouped --check ``` ## 🚨 Breaking Changes <!-- Does this PR introduce any breaking changes? If so, please describe the impact and migration path for clients. If you're unsure, the automated TypeScript compatibility check will run when you open/update this PR and provide feedback. For breaking changes: 1. Describe what changed in the client interface 2. Explain why the change was necessary 3. Provide migration steps for client developers 4. Link to any paired client PRs if needed Otherwise, you can remove this section. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent fc6d317 commit fd11c49

File tree

24 files changed

+63
-64
lines changed

24 files changed

+63
-64
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ jobs:
8787
RUSTFLAGS: "-D warnings"
8888

8989
- name: Install cargo-sort
90-
run: cargo install cargo-sort --locked --git https://github.com/DevinR528/cargo-sort.git --rev f5047967021cbb1f822faddc355b3b07674305a1
90+
run: cargo install cargo-sort --version 2.0.2 --locked
9191

9292
- name: Cargo sort
93-
run: cargo sort --workspace --check
93+
run: cargo sort --workspace --grouped --check
9494

9595
- name: Install cargo-udeps
9696
run: cargo install cargo-udeps --version 0.1.57 --locked

Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ reqwest = { version = ">=0.12.5, <0.13", features = [
7070
rsa = ">=0.9.2, <0.10"
7171
schemars = { version = ">=1.0.0, <2.0", features = ["uuid1", "chrono04"] }
7272
serde = { version = ">=1.0, <2.0", features = ["derive"] }
73+
serde-wasm-bindgen = ">=0.6.0, <0.7"
7374
serde_bytes = { version = ">=0.11.17, <0.12.0" }
7475
serde_json = ">=1.0.96, <2.0"
7576
serde_qs = ">=0.12.0, <0.16"
7677
serde_repr = ">=0.1.12, <0.2"
77-
serde-wasm-bindgen = ">=0.6.0, <0.7"
7878
sha1 = ">=0.10.5, <0.11"
7979
subtle = ">=2.5.0, <3.0"
8080
syn = ">=2.0.87, <3"
@@ -99,15 +99,6 @@ wasm-bindgen-test = "0.3.55"
9999
wiremock = ">=0.6.0, <0.7"
100100
zxcvbn = ">=3.0.1, <4.0"
101101

102-
[patch.crates-io]
103-
104-
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
105-
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
106-
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
107-
uniffi_internal_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
108-
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
109-
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
110-
111102
[workspace.lints.clippy]
112103
disallowed-macros = "deny"
113104
unused_async = "deny"
@@ -123,17 +114,26 @@ unexpected_cfgs = { level = "warn", check-cfg = [
123114
[workspace.metadata.dylint]
124115
libraries = [{ path = "support/lints" }]
125116

126-
# Compile all dependencies with some optimizations when building this crate on debug
127-
# This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster
128-
# As clean builds won't occur very often, this won't slow down the development process
129-
[profile.dev.package."*"]
130-
opt-level = 2
117+
[patch.crates-io]
118+
119+
uniffi = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
120+
uniffi_core = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
121+
uniffi_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
122+
uniffi_internal_macros = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
123+
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
124+
uniffi_build = { git = "https://github.com/mozilla/uniffi-rs", rev = "6d46b3f756dde3213357c477d86771a0fc5da7b4" }
131125

132126
# Turn on a small amount of optimisation in development mode. This might interfere when trying to use a debugger
133127
# if the compiler decides to optimize some code away, if that's the case, it can be set to 0 or commented out
134128
[profile.dev]
135129
opt-level = 1
136130

131+
# Compile all dependencies with some optimizations when building this crate on debug
132+
# This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster
133+
# As clean builds won't occur very often, this won't slow down the development process
134+
[profile.dev.package."*"]
135+
opt-level = 2
136+
137137
# Turn on LTO on release mode
138138
[profile.release]
139139
codegen-units = 1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ cargo +nightly fmt --check
142142
cargo +nightly udeps --workspace --all-features
143143
cargo clippy --all-features --all-targets
144144
cargo dylint --all -- --all-features --all-targets
145-
cargo sort --workspace --check
145+
cargo sort --workspace --grouped --check
146146
npm run lint
147147
```
148148

bitwarden_license/bitwarden-commercial-vault/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ uniffi = ["dep:uniffi"] # Uniffi bindings
1919
wasm = [
2020
"dep:tsify",
2121
"dep:wasm-bindgen",
22-
"dep:wasm-bindgen-futures"
22+
"dep:wasm-bindgen-futures",
2323
] # WASM support
2424

2525
[dependencies]

crates/bitwarden-auth/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wasm = [
1919
"bitwarden-core/wasm",
2020
"dep:tsify",
2121
"dep:wasm-bindgen",
22-
"dep:wasm-bindgen-futures"
22+
"dep:wasm-bindgen-futures",
2323
] # WASM support
2424

2525
# Note: dependencies must be alphabetized to pass the cargo sort check in the CI pipeline.

crates/bitwarden-collections/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ keywords.workspace = true
1414
uniffi = [
1515
"bitwarden-core/uniffi",
1616
"bitwarden-crypto/uniffi",
17-
"dep:uniffi"
17+
"dep:uniffi",
1818
] # Uniffi bindings
1919
wasm = ["bitwarden-core/wasm", "dep:tsify", "dep:wasm-bindgen"] # WASM support
2020

crates/bitwarden-core/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ keywords.workspace = true
1717
[features]
1818
internal = ["dep:zxcvbn"]
1919
no-memory-hardening = [
20-
"bitwarden-crypto/no-memory-hardening"
20+
"bitwarden-crypto/no-memory-hardening",
2121
] # Disable memory hardening features
2222
secrets = [] # Secrets manager API
2323
uniffi = [
2424
"internal",
2525
"bitwarden-crypto/uniffi",
2626
"bitwarden-encoding/uniffi",
2727
"dep:bitwarden-uniffi-error",
28-
"dep:uniffi"
28+
"dep:uniffi",
2929
] # Uniffi bindings
3030
wasm = [
3131
"bitwarden-crypto/wasm",
@@ -34,7 +34,7 @@ wasm = [
3434
"bitwarden-state/wasm",
3535
"dep:wasm-bindgen",
3636
"dep:wasm-bindgen-futures",
37-
"dep:tsify"
37+
"dep:tsify",
3838
] # WASM support
3939

4040
[dependencies]

crates/bitwarden-crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ uniffi = [
2121
"argon2/parallel",
2222
"bitwarden-encoding/uniffi",
2323
"dep:bitwarden-uniffi-error",
24-
"dep:uniffi"
24+
"dep:uniffi",
2525
] # Uniffi bindings
2626
wasm = ["dep:tsify", "dep:wasm-bindgen"] # WASM support
2727

crates/bitwarden-error-macro/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ repository.workspace = true
1414
license-file.workspace = true
1515
keywords.workspace = true
1616

17+
[lib]
18+
proc-macro = true
19+
1720
[features]
1821
wasm = []
1922

@@ -23,16 +26,13 @@ proc-macro2 = { workspace = true }
2326
quote = { workspace = true }
2427
syn = { workspace = true }
2528

26-
[lints]
27-
workspace = true
28-
29-
[lib]
30-
proc-macro = true
31-
3229
[dev-dependencies]
3330
bitwarden-error = { workspace = true, features = ["wasm"] }
3431
js-sys.workspace = true
3532
serde.workspace = true
3633
thiserror.workspace = true
3734
tsify.workspace = true
3835
wasm-bindgen.workspace = true
36+
37+
[lints]
38+
workspace = true

crates/bitwarden-error/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wasm = [
1919
"bitwarden-error-macro/wasm",
2020
"dep:js-sys",
2121
"dep:tsify",
22-
"dep:wasm-bindgen"
22+
"dep:wasm-bindgen",
2323
]
2424

2525
[dependencies]
@@ -28,10 +28,10 @@ js-sys = { workspace = true, optional = true }
2828
tsify = { workspace = true, optional = true }
2929
wasm-bindgen = { workspace = true, optional = true }
3030

31-
[lints]
32-
workspace = true
33-
3431
[dev-dependencies]
3532
serde.workspace = true
3633
trybuild = "1.0.101"
3734
wasm-bindgen-test = { workspace = true }
35+
36+
[lints]
37+
workspace = true

0 commit comments

Comments
 (0)