Skip to content

Commit f65350a

Browse files
xtqqczzecakebaker
authored andcommitted
toml: avoid defining tables out-of-order
fix `Tombi(tables-out-of-order)` lint
1 parent 6276737 commit f65350a

7 files changed

Lines changed: 90 additions & 90 deletions

File tree

Cargo.toml

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,66 @@ uu_base32 = { version = "0.8.0", path = "src/uu/base32" }
495495
uu_checksum_common = { version = "0.8.0", path = "src/uu/checksum_common" }
496496
uutests = { version = "0.8.0", package = "uutests", path = "tests/uutests" }
497497

498+
# This is the linting configuration for all crates.
499+
# In order to use these, all crates have `[lints] workspace = true` section.
500+
[workspace.lints.rust]
501+
# Allow "fuzzing" as a "cfg" condition name and "cygwin" as a value for "target_os"
502+
# https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html
503+
unexpected_cfgs = { level = "warn", check-cfg = [
504+
'cfg(fuzzing)',
505+
'cfg(target_os, values("cygwin"))',
506+
'cfg(wasi_runner)',
507+
] }
508+
unused_qualifications = "warn"
509+
510+
[workspace.lints.clippy]
511+
collapsible_if = { level = "allow", priority = 127 } # remove me
512+
# The counts were generated with this command:
513+
# cargo clippy --all-targets --workspace --message-format=json --quiet \
514+
# | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' \
515+
# | sort | uniq -c | sort -h -r
516+
#
517+
all = { level = "warn", priority = -1 }
518+
cargo = { level = "warn", priority = -1 }
519+
pedantic = { level = "warn", priority = -1 }
520+
use_self = "warn" # nursery lint
521+
cargo_common_metadata = "allow" # 3240
522+
multiple_crate_versions = "allow" # 2882
523+
missing_errors_doc = "allow" # 1572
524+
missing_panics_doc = "allow" # 946
525+
must_use_candidate = "allow" # 322
526+
match_same_arms = "allow" # 204
527+
cast_possible_truncation = "allow" # 122
528+
too_many_lines = "allow" # 101
529+
cast_possible_wrap = "allow" # 78
530+
cast_sign_loss = "allow" # 70
531+
struct_excessive_bools = "allow" # 68
532+
cast_precision_loss = "allow" # 52
533+
cast_lossless = "allow" # 35
534+
ignored_unit_patterns = "allow" # 21
535+
similar_names = "allow" # 20
536+
needless_pass_by_value = "allow" # 16
537+
float_cmp = "allow" # 12
538+
return_self_not_must_use = "allow" # 8
539+
inline_always = "allow" # 6
540+
fn_params_excessive_bools = "allow" # 6
541+
used_underscore_items = "allow" # 2
542+
should_panic_without_expect = "allow" # 2
543+
544+
doc_markdown = "allow"
545+
unused_self = "allow"
546+
enum_glob_use = "allow"
547+
unnested_or_patterns = "allow"
548+
implicit_hasher = "allow"
549+
doc_link_with_quotes = "allow"
550+
format_push_string = "allow"
551+
flat_map_option = "allow"
552+
from_iter_instead_of_collect = "allow"
553+
large_types_passed_by_value = "allow"
554+
555+
[workspace.metadata.cargo-shear]
556+
ignored = ["clap", "fluent", "libstdbuf"]
557+
498558
[dependencies]
499559
clap.workspace = true
500560
clap_complete = { workspace = true, optional = true }
@@ -621,17 +681,6 @@ who = { optional = true, version = "0.8.0", package = "uu_who", path = "src/uu/w
621681
whoami = { optional = true, version = "0.8.0", package = "uu_whoami", path = "src/uu/whoami" }
622682
yes = { optional = true, version = "0.8.0", package = "uu_yes", path = "src/uu/yes" }
623683

624-
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
625-
rustix.workspace = true
626-
627-
# this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)"
628-
# factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" }
629-
630-
#
631-
# * pinned transitive dependencies
632-
# Not needed for now. Keep as examples:
633-
#pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)
634-
635684
[dev-dependencies]
636685
ctor.workspace = true
637686
filetime.workspace = true
@@ -663,6 +712,17 @@ hex-literal = "1.0.0"
663712
rstest.workspace = true
664713
rstest_reuse.workspace = true
665714

715+
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
716+
rustix.workspace = true
717+
718+
# this breaks clippy linting with: "tests/by-util/test_factor_benches.rs: No such file or directory (os error 2)"
719+
# factor_benches = { optional = true, version = "0.0.0", package = "uu_factor_benches", path = "tests/benches/factor" }
720+
721+
#
722+
# * pinned transitive dependencies
723+
# Not needed for now. Keep as examples:
724+
#pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)
725+
666726
[target.'cfg(unix)'.dev-dependencies]
667727
nix = { workspace = true, features = [
668728
"process",
@@ -707,63 +767,3 @@ debug = true
707767

708768
[lints]
709769
workspace = true
710-
711-
# This is the linting configuration for all crates.
712-
# In order to use these, all crates have `[lints] workspace = true` section.
713-
[workspace.lints.rust]
714-
# Allow "fuzzing" as a "cfg" condition name and "cygwin" as a value for "target_os"
715-
# https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html
716-
unexpected_cfgs = { level = "warn", check-cfg = [
717-
'cfg(fuzzing)',
718-
'cfg(target_os, values("cygwin"))',
719-
'cfg(wasi_runner)',
720-
] }
721-
unused_qualifications = "warn"
722-
723-
[workspace.lints.clippy]
724-
collapsible_if = { level = "allow", priority = 127 } # remove me
725-
# The counts were generated with this command:
726-
# cargo clippy --all-targets --workspace --message-format=json --quiet \
727-
# | jq -r '.message.code.code | select(. != null and startswith("clippy::"))' \
728-
# | sort | uniq -c | sort -h -r
729-
#
730-
all = { level = "warn", priority = -1 }
731-
cargo = { level = "warn", priority = -1 }
732-
pedantic = { level = "warn", priority = -1 }
733-
use_self = "warn" # nursery lint
734-
cargo_common_metadata = "allow" # 3240
735-
multiple_crate_versions = "allow" # 2882
736-
missing_errors_doc = "allow" # 1572
737-
missing_panics_doc = "allow" # 946
738-
must_use_candidate = "allow" # 322
739-
match_same_arms = "allow" # 204
740-
cast_possible_truncation = "allow" # 122
741-
too_many_lines = "allow" # 101
742-
cast_possible_wrap = "allow" # 78
743-
cast_sign_loss = "allow" # 70
744-
struct_excessive_bools = "allow" # 68
745-
cast_precision_loss = "allow" # 52
746-
cast_lossless = "allow" # 35
747-
ignored_unit_patterns = "allow" # 21
748-
similar_names = "allow" # 20
749-
needless_pass_by_value = "allow" # 16
750-
float_cmp = "allow" # 12
751-
return_self_not_must_use = "allow" # 8
752-
inline_always = "allow" # 6
753-
fn_params_excessive_bools = "allow" # 6
754-
used_underscore_items = "allow" # 2
755-
should_panic_without_expect = "allow" # 2
756-
757-
doc_markdown = "allow"
758-
unused_self = "allow"
759-
enum_glob_use = "allow"
760-
unnested_or_patterns = "allow"
761-
implicit_hasher = "allow"
762-
doc_link_with_quotes = "allow"
763-
format_push_string = "allow"
764-
flat_map_option = "allow"
765-
from_iter_instead_of_collect = "allow"
766-
large_types_passed_by_value = "allow"
767-
768-
[workspace.metadata.cargo-shear]
769-
ignored = ["clap", "fluent", "libstdbuf"]

fuzz/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ rust-version.workspace = true
88
license.workspace = true
99
publish = false
1010

11+
[package.metadata]
12+
cargo-fuzz = true
13+
1114
# Prevent this from interfering with workspaces
1215
[workspace]
1316
members = ["."]
@@ -17,9 +20,6 @@ edition = "2024"
1720
rust-version = "1.88.0"
1821
license = "MIT"
1922

20-
[package.metadata]
21-
cargo-fuzz = true
22-
2323
# Enable debug symbols in release builds for readable backtraces
2424
# when fuzzing discovers crashes. This addresses issue #5343.
2525
[profile.release]

src/uu/cat/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ thiserror = { workspace = true }
2626
uucore = { workspace = true, features = ["fast-inc", "fs", "pipes", "signals"] }
2727
fluent = { workspace = true }
2828

29-
[target.'cfg(windows)'.dependencies]
30-
winapi-util = { workspace = true }
31-
windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem"] }
32-
3329
[dev-dependencies]
3430
divan = { workspace = true }
3531
tempfile = { workspace = true }
3632
uucore = { workspace = true, features = ["benchmark"] }
3733

34+
[target.'cfg(windows)'.dependencies]
35+
winapi-util = { workspace = true }
36+
windows-sys = { workspace = true, features = ["Win32_Storage_FileSystem"] }
37+
3838
[target.'cfg(unix)'.dev-dependencies]
3939
rustix = { workspace = true }
4040

src/uu/hostname/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ edition.workspace = true
1111
rust-version.workspace = true
1212
readme.workspace = true
1313

14+
[package.metadata.cargo-udeps.ignore]
15+
normal = ["uucore_procs"]
16+
1417
[lints]
1518
workspace = true
1619

@@ -38,9 +41,6 @@ windows-sys = { workspace = true, features = [
3841
name = "hostname"
3942
path = "src/main.rs"
4043

41-
[package.metadata.cargo-udeps.ignore]
42-
normal = ["uucore_procs"]
43-
4444
[[bench]]
4545
name = "hostname_bench"
4646
harness = false

src/uu/sync/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ edition.workspace = true
1111
rust-version.workspace = true
1212
readme.workspace = true
1313

14+
[package.metadata.cargo-udeps.ignore]
15+
normal = ["uucore_procs"]
16+
1417
[lints]
1518
workspace = true
1619

@@ -37,6 +40,3 @@ windows-sys = { workspace = true, features = [
3740
[[bin]]
3841
name = "sync"
3942
path = "src/main.rs"
40-
41-
[package.metadata.cargo-udeps.ignore]
42-
normal = ["uucore_procs"]

src/uu/touch/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ thiserror = { workspace = true }
2828
uucore = { workspace = true, features = ["libc", "parser"] }
2929
fluent = { workspace = true }
3030

31+
[dev-dependencies]
32+
tempfile = { workspace = true }
33+
3134
[target.'cfg(unix)'.dependencies]
3235
libc = { workspace = true }
3336
rustix = { workspace = true, features = ["fs"] }
3437

35-
[dev-dependencies]
36-
tempfile = { workspace = true }
37-
3838
[target.'cfg(target_os = "windows")'.dependencies]
3939
windows-sys = { workspace = true, features = [
4040
"Win32_Storage_FileSystem",

src/uucore/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ fluent-syntax = { workspace = true }
9292
unic-langid = { workspace = true }
9393
thiserror = { workspace = true }
9494

95+
[dev-dependencies]
96+
tempfile = { workspace = true }
97+
9598
[target.'cfg(unix)'.dependencies]
9699
nix = { workspace = true, features = [
97100
"dir",
@@ -105,9 +108,6 @@ nix = { workspace = true, features = [
105108
walkdir = { workspace = true, optional = true }
106109
xattr = { workspace = true, optional = true }
107110

108-
[dev-dependencies]
109-
tempfile = { workspace = true }
110-
111111
[target.'cfg(target_os = "linux")'.dependencies]
112112
procfs = { workspace = true, optional = true }
113113

0 commit comments

Comments
 (0)