Skip to content

Commit 4f12412

Browse files
committed
tidy: sort lists in deps.rs using tidy-alphabetical
1 parent a083986 commit 4f12412

File tree

1 file changed

+45
-34
lines changed

1 file changed

+45
-34
lines changed

src/tools/tidy/src/deps.rs

+45-34
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,53 @@ use std::path::Path;
66

77
/// These are licenses that are allowed for all crates, including the runtime,
88
/// rustc, tools, etc.
9+
#[rustfmt::skip]
910
const LICENSES: &[&str] = &[
10-
"MIT/Apache-2.0",
11-
"MIT / Apache-2.0",
12-
"Apache-2.0/MIT",
11+
// tidy-alphabetical-start
12+
"(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
13+
"0BSD OR MIT OR Apache-2.0", // adler license
14+
"0BSD",
1315
"Apache-2.0 / MIT",
14-
"MIT OR Apache-2.0",
1516
"Apache-2.0 OR MIT",
1617
"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
17-
"MIT",
18+
"Apache-2.0/MIT",
1819
"ISC",
19-
"Unlicense/MIT",
20+
"MIT / Apache-2.0",
21+
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
22+
"MIT OR Apache-2.0",
23+
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
24+
"MIT",
25+
"MIT/Apache-2.0",
26+
"Unicode-DFS-2016", // tinystr and icu4x
2027
"Unlicense OR MIT",
21-
"0BSD",
22-
"0BSD OR MIT OR Apache-2.0", // adler license
23-
"Zlib OR Apache-2.0 OR MIT", // tinyvec
24-
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
25-
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
26-
"(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
27-
"Unicode-DFS-2016", // tinystr and icu4x
28+
"Unlicense/MIT",
29+
"Zlib OR Apache-2.0 OR MIT", // tinyvec
30+
// tidy-alphabetical-end
2831
];
2932

3033
/// These are exceptions to Rust's permissive licensing policy, and
3134
/// should be considered bugs. Exceptions are only allowed in Rust
3235
/// tooling. It is _crucial_ that no exception crates be dependencies
3336
/// of the Rust runtime (std/test).
37+
#[rustfmt::skip]
3438
const EXCEPTIONS: &[(&str, &str)] = &[
39+
// tidy-alphabetical-start
3540
("ar_archive_writer", "Apache-2.0 WITH LLVM-exception"), // rustc
36-
("mdbook", "MPL-2.0"), // mdbook
41+
("codespan-reporting", "Apache-2.0"), // cxx via iana-time-zone-haiku via time, only on haiku
3742
("colored", "MPL-2.0"), // rustfmt
43+
("dissimilar", "Apache-2.0"), // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
44+
("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
45+
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target. FIXME: this dependency violates the documentation comment above.
46+
("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
47+
("mdbook", "MPL-2.0"), // mdbook
3848
("ryu", "Apache-2.0 OR BSL-1.0"), // cargo/... (because of serde)
39-
("codespan-reporting", "Apache-2.0"), // cxx via iana-time-zone-haiku via time, only on haiku
40-
("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
41-
("snap", "BSD-3-Clause"), // rustc
42-
("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
43-
("self_cell", "Apache-2.0"), // rustc (fluent translations)
44-
// FIXME: this dependency violates the documentation comment above:
45-
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target
46-
("dissimilar", "Apache-2.0"), // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
49+
("self_cell", "Apache-2.0"), // rustc (fluent translations)
50+
("snap", "BSD-3-Clause"), // rustc
51+
// tidy-alphabetical-end
4752
];
4853

4954
const EXCEPTIONS_CARGO: &[(&str, &str)] = &[
55+
// tidy-alphabetical-start
5056
("bitmaps", "MPL-2.0+"),
5157
("bytesize", "Apache-2.0"),
5258
("dunce", "CC0-1.0 OR MIT-0"),
@@ -62,9 +68,11 @@ const EXCEPTIONS_CARGO: &[(&str, &str)] = &[
6268
("sized-chunks", "MPL-2.0+"),
6369
("subtle", "BSD-3-Clause"),
6470
("unicode-bom", "Apache-2.0"),
71+
// tidy-alphabetical-end
6572
];
6673

6774
const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[
75+
// tidy-alphabetical-start
6876
("cranelift-bforest", "Apache-2.0 WITH LLVM-exception"),
6977
("cranelift-codegen", "Apache-2.0 WITH LLVM-exception"),
7078
("cranelift-codegen-meta", "Apache-2.0 WITH LLVM-exception"),
@@ -80,6 +88,7 @@ const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[
8088
("regalloc2", "Apache-2.0 WITH LLVM-exception"),
8189
("target-lexicon", "Apache-2.0 WITH LLVM-exception"),
8290
("wasmtime-jit-icache-coherence", "Apache-2.0 WITH LLVM-exception"),
91+
// tidy-alphabetical-end
8392
];
8493

8594
const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
@@ -95,6 +104,7 @@ const RUNTIME_CRATES: &[&str] = &["std", "core", "alloc", "test", "panic_abort",
95104
/// This list is here to provide a speed-bump to adding a new dependency to
96105
/// rustc. Please check with the compiler team before adding an entry.
97106
const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
107+
// tidy-alphabetical-start
98108
"addr2line",
99109
"adler",
100110
"ahash",
@@ -113,8 +123,8 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
113123
"chalk-engine",
114124
"chalk-ir",
115125
"chalk-solve",
116-
"convert_case", // dependency of derive_more
117126
"compiler_builtins",
127+
"convert_case", // dependency of derive_more
118128
"cpufeatures",
119129
"crc32fast",
120130
"crossbeam-channel",
@@ -187,8 +197,8 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
187197
"ppv-lite86",
188198
"proc-macro-hack",
189199
"proc-macro2",
190-
"pulldown-cmark",
191200
"psm",
201+
"pulldown-cmark",
192202
"punycode",
193203
"quote",
194204
"rand",
@@ -227,14 +237,14 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
227237
"tempfile",
228238
"termcolor",
229239
"termize",
240+
"thin-vec",
230241
"thiserror",
231242
"thiserror-impl",
232243
"thorin-dwp",
233244
"thread_local",
234245
"tinystr",
235246
"tinyvec",
236247
"tinyvec_macros",
237-
"thin-vec",
238248
"tracing",
239249
"tracing-attributes",
240250
"tracing-core",
@@ -263,37 +273,37 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
263273
"valuable",
264274
"version_check",
265275
"wasi",
266-
"windows",
267276
"winapi",
268277
"winapi-i686-pc-windows-gnu",
269278
"winapi-util",
270279
"winapi-x86_64-pc-windows-gnu",
280+
"windows",
271281
"windows-targets",
272-
"windows_aarch64_msvc",
273282
"windows_aarch64_gnullvm",
274-
"windows_x86_64_gnullvm",
275-
"windows_i686_msvc",
283+
"windows_aarch64_msvc",
276284
"windows_i686_gnu",
277-
"windows_x86_64_msvc",
285+
"windows_i686_msvc",
278286
"windows_x86_64_gnu",
287+
"windows_x86_64_gnullvm",
288+
"windows_x86_64_msvc",
279289
"writeable",
280-
// this is a false-positive: it's only used by rustfmt, but because it's enabled through a
281-
// feature, tidy thinks it's used by rustc as well.
282-
"yansi-term",
290+
"yansi-term", // this is a false-positive: it's only used by rustfmt, but because it's enabled through a feature, tidy thinks it's used by rustc as well.
283291
"yoke",
284292
"yoke-derive",
285293
"zerofrom",
286294
"zerofrom-derive",
287295
"zerovec",
288296
"zerovec-derive",
297+
// tidy-alphabetical-end
289298
];
290299

291300
const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
301+
// tidy-alphabetical-start
292302
"ahash",
293303
"anyhow",
294304
"autocfg",
295-
"bumpalo",
296305
"bitflags",
306+
"bumpalo",
297307
"byteorder",
298308
"cfg-if",
299309
"cranelift-bforest",
@@ -332,6 +342,7 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
332342
"winapi-i686-pc-windows-gnu",
333343
"winapi-x86_64-pc-windows-gnu",
334344
"windows-sys",
345+
// tidy-alphabetical-end
335346
];
336347

337348
/// Dependency checks.

0 commit comments

Comments
 (0)