@@ -495,6 +495,66 @@ uu_base32 = { version = "0.8.0", path = "src/uu/base32" }
495495uu_checksum_common = { version = " 0.8.0" , path = " src/uu/checksum_common" }
496496uutests = { 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 ]
499559clap.workspace = true
500560clap_complete = { workspace = true , optional = true }
@@ -621,17 +681,6 @@ who = { optional = true, version = "0.8.0", package = "uu_who", path = "src/uu/w
621681whoami = { optional = true , version = " 0.8.0" , package = " uu_whoami" , path = " src/uu/whoami" }
622682yes = { 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 ]
636685ctor.workspace = true
637686filetime.workspace = true
@@ -663,6 +712,17 @@ hex-literal = "1.0.0"
663712rstest.workspace = true
664713rstest_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 ]
667727nix = { workspace = true , features = [
668728 " process" ,
@@ -707,63 +767,3 @@ debug = true
707767
708768[lints ]
709769workspace = 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" ]
0 commit comments