From 2e0ce506968c112b215ca0056bd2742e7235df48 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 24 Aug 2024 09:56:18 -0400 Subject: [PATCH 1/5] Workspace Clippy lint management Make all lints managed centrally in one place. Note that this approach forces pedantic lints on the entire codebase - which means that when the new versions of rust are released, some new lint may fail the build. At the same time, this allows new lints to always be noticed and manually excluded. The big list of allowed lints can be slowly worked through and forbidden one by one. --- Cargo.toml | 78 +++++++++++++++++++++++++++++ gitoxide-core/Cargo.toml | 2 + gix-actor/Cargo.toml | 2 + gix-archive/Cargo.toml | 2 + gix-attributes/Cargo.toml | 2 + gix-attributes/fuzz/Cargo.toml | 2 + gix-bitmap/Cargo.toml | 4 +- gix-blame/Cargo.toml | 2 + gix-chunk/Cargo.toml | 2 + gix-command/Cargo.toml | 2 + gix-commitgraph/Cargo.toml | 2 + gix-commitgraph/fuzz/Cargo.toml | 2 + gix-config-value/Cargo.toml | 2 + gix-config-value/fuzz/Cargo.toml | 2 + gix-config/Cargo.toml | 2 + gix-config/fuzz/Cargo.toml | 1 + gix-config/tests/Cargo.toml | 4 +- gix-credentials/Cargo.toml | 2 + gix-date/Cargo.toml | 2 + gix-date/fuzz/Cargo.toml | 2 + gix-diff/Cargo.toml | 2 + gix-diff/tests/Cargo.toml | 2 + gix-dir/Cargo.toml | 2 + gix-discover/Cargo.toml | 2 + gix-features/Cargo.toml | 2 + gix-fetchhead/Cargo.toml | 2 + gix-filter/Cargo.toml | 2 + gix-fs/Cargo.toml | 2 + gix-fsck/Cargo.toml | 4 +- gix-glob/Cargo.toml | 2 + gix-hash/Cargo.toml | 2 + gix-hashtable/Cargo.toml | 7 +-- gix-ignore/Cargo.toml | 2 + gix-index/Cargo.toml | 2 + gix-index/tests/Cargo.toml | 2 + gix-lfs/Cargo.toml | 2 + gix-lock/Cargo.toml | 2 + gix-macros/Cargo.toml | 2 + gix-mailmap/Cargo.toml | 2 + gix-negotiate/Cargo.toml | 2 + gix-note/Cargo.toml | 2 + gix-object/Cargo.toml | 2 + gix-object/fuzz/Cargo.toml | 2 + gix-odb/Cargo.toml | 2 + gix-odb/tests/Cargo.toml | 3 +- gix-pack/Cargo.toml | 4 +- gix-pack/tests/Cargo.toml | 10 ++-- gix-packetline-blocking/Cargo.toml | 2 + gix-packetline/Cargo.toml | 2 + gix-path/Cargo.toml | 2 + gix-pathspec/Cargo.toml | 2 + gix-pathspec/fuzz/Cargo.toml | 2 + gix-prompt/Cargo.toml | 2 + gix-protocol/Cargo.toml | 2 + gix-quote/Cargo.toml | 2 + gix-rebase/Cargo.toml | 2 + gix-ref/Cargo.toml | 2 + gix-ref/fuzz/Cargo.toml | 2 + gix-ref/tests/Cargo.toml | 4 +- gix-refspec/Cargo.toml | 4 +- gix-refspec/fuzz/Cargo.toml | 2 + gix-revision/Cargo.toml | 2 + gix-revision/fuzz/Cargo.toml | 2 + gix-revwalk/Cargo.toml | 2 + gix-sec/Cargo.toml | 2 + gix-sequencer/Cargo.toml | 2 + gix-status/Cargo.toml | 2 + gix-status/tests/Cargo.toml | 2 + gix-submodule/Cargo.toml | 5 +- gix-tempfile/Cargo.toml | 3 +- gix-tix/Cargo.toml | 2 + gix-trace/Cargo.toml | 6 ++- gix-transport/Cargo.toml | 2 + gix-traverse/Cargo.toml | 2 + gix-traverse/tests/Cargo.toml | 4 +- gix-tui/Cargo.toml | 2 + gix-url/Cargo.toml | 2 + gix-url/fuzz/Cargo.toml | 2 + gix-utils/Cargo.toml | 3 +- gix-validate/Cargo.toml | 2 + gix-worktree-state/Cargo.toml | 2 + gix-worktree-state/tests/Cargo.toml | 2 + gix-worktree-stream/Cargo.toml | 8 +-- gix-worktree/Cargo.toml | 2 + gix-worktree/tests/Cargo.toml | 2 + gix/Cargo.toml | 2 + tests/it/Cargo.toml | 3 +- tests/tools/Cargo.toml | 2 + 88 files changed, 270 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 49da0a91820..6334cbf98c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gitoxide" description = "A command-line application for interacting with git repositories" @@ -311,3 +313,79 @@ features = ["document-features", "max"] [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/gitoxide-max-pure-v{ version }-{ target }{ archive-suffix }" bin-dir = "gitoxide-max-pure-v{ version }-{ target }/{ bin }{ binary-ext }" + +[workspace.lints.rust] +# TODO: enable this +# unused_qualifications = "warn" + +[workspace.lints.clippy] +pedantic = { level = "warn", priority = -1 } +# +# Reviewed and allowed lints +enum_glob_use = "allow" # x97 +missing_errors_doc = "allow" # x1792 +missing_panics_doc = "allow" # x447 +module_name_repetitions = "allow" # x125 +must_use_candidate = "allow" # x1696 +# +# Lints that we may want to forbid in the future +default_trait_access = "allow" # x709 +doc_markdown = "allow" # x552 +cast_possible_truncation = "allow" # x216 +needless_pass_by_value = "allow" # x205 +return_self_not_must_use = "allow" # x204 +unreadable_literal = "allow" # x169 +items_after_statements = "allow" # x164 +single_match_else = "allow" # x162 +too_many_lines = "allow" # x161 +unnecessary_wraps = "allow" # x110 +match_same_arms = "allow" # x99 +cast_lossless = "allow" # x91 +ignored_unit_patterns = "allow" # x80 +used_underscore_binding = "allow" # x75 +needless_raw_string_hashes = "allow" # x75 +implicit_clone = "allow" # x70 +manual_let_else = "allow" # x64 +cast_precision_loss = "allow" # x56 +trivially_copy_pass_by_ref = "allow" # x43 +redundant_else = "allow" # x42 +if_not_else = "allow" # x37 +match_wildcard_for_single_variants = "allow" # x35 +cast_sign_loss = "allow" # x35 +similar_names = "allow" # x32 +struct_excessive_bools = "allow" # x29 +cast_possible_wrap = "allow" # x26 +explicit_iter_loop = "allow" # x24 +explicit_into_iter_loop = "allow" # x22 +explicit_deref_methods = "allow" # x22 +inconsistent_struct_constructor = "allow" # x18 +range_plus_one = "allow" # x17 +inefficient_to_string = "allow" # x14 +from_iter_instead_of_collect = "allow" # x13 +unused_self = "allow" # x10 +many_single_char_names = "allow" # x10 +manual_string_new = "allow" # x10 +iter_not_returning_iterator = "allow" # x10 +option_option = "allow" # x9 +inline_always = "allow" # x8 +manual_assert = "allow" # x7 +iter_without_into_iter = "allow" # x6 +copy_iterator = "allow" # x6 +should_panic_without_expect = "allow" # x5 +transmute_ptr_to_ptr = "allow" # x4 +match_wild_err_arm = "allow" # x4 +manual_is_variant_and = "allow" # x4 +bool_to_int_with_if = "allow" # x4 +struct_field_names = "allow" # x3 +wildcard_imports = "allow" # x2 +needless_for_each = "allow" # x2 +naive_bytecount = "allow" # x2 +mut_mut = "allow" # x2 +match_bool = "allow" # x2 +fn_params_excessive_bools = "allow" # x2 +filter_map_next = "allow" # x2 +checked_conversions = "allow" # x2 +borrow_as_ptr = "allow" # x2 +unnecessary_join = "allow" # x1 +stable_sort_primitive = "allow" # x1 +no_effect_underscore_binding = "allow" # x1 diff --git a/gitoxide-core/Cargo.toml b/gitoxide-core/Cargo.toml index 1c50b3530cb..9e4c005f4f7 100644 --- a/gitoxide-core/Cargo.toml +++ b/gitoxide-core/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gitoxide-core" description = "The library implementing all capabilities of the gitoxide CLI" diff --git a/gix-actor/Cargo.toml b/gix-actor/Cargo.toml index 3255f7b74b9..313da1818e3 100644 --- a/gix-actor/Cargo.toml +++ b/gix-actor/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-actor" version = "0.32.0" diff --git a/gix-archive/Cargo.toml b/gix-archive/Cargo.toml index 4d67d3f3106..989ea207a59 100644 --- a/gix-archive/Cargo.toml +++ b/gix-archive/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-archive" version = "0.15.0" diff --git a/gix-attributes/Cargo.toml b/gix-attributes/Cargo.toml index 1df5217ef3d..e8428a2c0f4 100644 --- a/gix-attributes/Cargo.toml +++ b/gix-attributes/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-attributes" version = "0.22.5" diff --git a/gix-attributes/fuzz/Cargo.toml b/gix-attributes/fuzz/Cargo.toml index d960e11f177..f303f3a2dfa 100644 --- a/gix-attributes/fuzz/Cargo.toml +++ b/gix-attributes/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-attributes-fuzz" version = "0.0.0" diff --git a/gix-bitmap/Cargo.toml b/gix-bitmap/Cargo.toml index 1a14e8b1a50..85e4b34b165 100644 --- a/gix-bitmap/Cargo.toml +++ b/gix-bitmap/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-bitmap" version = "0.2.11" @@ -17,4 +19,4 @@ test = true thiserror = "1.0.38" [dev-dependencies] -gix-testtools = { path = "../tests/tools"} +gix-testtools = { path = "../tests/tools" } diff --git a/gix-blame/Cargo.toml b/gix-blame/Cargo.toml index 2120dd2bda1..e448ea00fe2 100644 --- a/gix-blame/Cargo.toml +++ b/gix-blame/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-blame" version = "0.0.0" diff --git a/gix-chunk/Cargo.toml b/gix-chunk/Cargo.toml index 94b1b9fc4e9..4526780a23e 100644 --- a/gix-chunk/Cargo.toml +++ b/gix-chunk/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-chunk" version = "0.4.8" diff --git a/gix-command/Cargo.toml b/gix-command/Cargo.toml index 1f4211ba29b..7b58352a008 100644 --- a/gix-command/Cargo.toml +++ b/gix-command/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-command" version = "0.3.9" diff --git a/gix-commitgraph/Cargo.toml b/gix-commitgraph/Cargo.toml index c061239a25b..ae76a6ed857 100644 --- a/gix-commitgraph/Cargo.toml +++ b/gix-commitgraph/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-commitgraph" version = "0.24.3" diff --git a/gix-commitgraph/fuzz/Cargo.toml b/gix-commitgraph/fuzz/Cargo.toml index b15f90419ea..3c0785371d5 100644 --- a/gix-commitgraph/fuzz/Cargo.toml +++ b/gix-commitgraph/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-commitgraph-fuzz" version = "0.0.0" diff --git a/gix-config-value/Cargo.toml b/gix-config-value/Cargo.toml index 6841b501147..3379db5c527 100644 --- a/gix-config-value/Cargo.toml +++ b/gix-config-value/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-config-value" version = "0.14.8" diff --git a/gix-config-value/fuzz/Cargo.toml b/gix-config-value/fuzz/Cargo.toml index 0a3d571f672..11a817996bc 100644 --- a/gix-config-value/fuzz/Cargo.toml +++ b/gix-config-value/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-config-value-fuzz" version = "0.0.0" diff --git a/gix-config/Cargo.toml b/gix-config/Cargo.toml index 12cfa189d74..7ef3e93e31b 100644 --- a/gix-config/Cargo.toml +++ b/gix-config/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-config" version = "0.40.0" diff --git a/gix-config/fuzz/Cargo.toml b/gix-config/fuzz/Cargo.toml index 06762f35cea..5232c4e1541 100644 --- a/gix-config/fuzz/Cargo.toml +++ b/gix-config/fuzz/Cargo.toml @@ -1,3 +1,4 @@ +lints.workspace = true [package] name = "gix-config-fuzz" diff --git a/gix-config/tests/Cargo.toml b/gix-config/tests/Cargo.toml index 0448769115c..6ec64ce2626 100644 --- a/gix-config/tests/Cargo.toml +++ b/gix-config/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-config-tests" version = "0.0.0" @@ -29,4 +31,4 @@ serial_test = { version = "3.1.0", default-features = false } bstr = { version = "1.3.0", default-features = false, features = ["std"] } bytesize = "1.3.0" -cap = { version = "0.1.2", features = ["stats"] } \ No newline at end of file +cap = { version = "0.1.2", features = ["stats"] } diff --git a/gix-credentials/Cargo.toml b/gix-credentials/Cargo.toml index 8b47af7bfc4..623f3794dcc 100644 --- a/gix-credentials/Cargo.toml +++ b/gix-credentials/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-credentials" version = "0.24.5" diff --git a/gix-date/Cargo.toml b/gix-date/Cargo.toml index 12f78326d89..130c9ae53f9 100644 --- a/gix-date/Cargo.toml +++ b/gix-date/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-date" version = "0.9.0" diff --git a/gix-date/fuzz/Cargo.toml b/gix-date/fuzz/Cargo.toml index 302d749326d..ae4dc16c323 100644 --- a/gix-date/fuzz/Cargo.toml +++ b/gix-date/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-date-fuzz" version = "0.0.0" diff --git a/gix-diff/Cargo.toml b/gix-diff/Cargo.toml index a4bb9d5e7ee..df653d21985 100644 --- a/gix-diff/Cargo.toml +++ b/gix-diff/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-diff" version = "0.46.0" diff --git a/gix-diff/tests/Cargo.toml b/gix-diff/tests/Cargo.toml index 695508cf1aa..86aa0d446e5 100644 --- a/gix-diff/tests/Cargo.toml +++ b/gix-diff/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-diff-tests" version = "0.0.0" diff --git a/gix-dir/Cargo.toml b/gix-dir/Cargo.toml index df5d725b026..c6e9e0656f2 100644 --- a/gix-dir/Cargo.toml +++ b/gix-dir/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-dir" version = "0.8.0" diff --git a/gix-discover/Cargo.toml b/gix-discover/Cargo.toml index 6d14a5beb04..fa07e3521b5 100644 --- a/gix-discover/Cargo.toml +++ b/gix-discover/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-discover" version = "0.35.0" diff --git a/gix-features/Cargo.toml b/gix-features/Cargo.toml index 10fd28d38f2..717d9fb4e25 100644 --- a/gix-features/Cargo.toml +++ b/gix-features/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-features" description = "A crate to integrate various capabilities using compile-time feature flags" diff --git a/gix-fetchhead/Cargo.toml b/gix-fetchhead/Cargo.toml index 7d1a293f9f1..2e43cbc8b8e 100644 --- a/gix-fetchhead/Cargo.toml +++ b/gix-fetchhead/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-fetchhead" version = "0.0.0" diff --git a/gix-filter/Cargo.toml b/gix-filter/Cargo.toml index 54254f162c7..cb7e9eda1b6 100644 --- a/gix-filter/Cargo.toml +++ b/gix-filter/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-filter" version = "0.13.0" diff --git a/gix-fs/Cargo.toml b/gix-fs/Cargo.toml index 3087a422875..5ec41b031d6 100644 --- a/gix-fs/Cargo.toml +++ b/gix-fs/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-fs" version = "0.11.3" diff --git a/gix-fsck/Cargo.toml b/gix-fsck/Cargo.toml index 0fdfd045a0e..c95d977b6d6 100644 --- a/gix-fsck/Cargo.toml +++ b/gix-fsck/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-fsck" version = "0.6.0" @@ -19,4 +21,4 @@ gix-object = { version = "^0.44.0", path = "../gix-object" } [dev-dependencies] gix-odb = { path = "../gix-odb" } -gix-testtools = { path = "../tests/tools"} +gix-testtools = { path = "../tests/tools" } diff --git a/gix-glob/Cargo.toml b/gix-glob/Cargo.toml index 878ff9c1aee..0b4e40f5bfb 100644 --- a/gix-glob/Cargo.toml +++ b/gix-glob/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-glob" version = "0.16.5" diff --git a/gix-hash/Cargo.toml b/gix-hash/Cargo.toml index ee6cc063d76..0eb953086a3 100644 --- a/gix-hash/Cargo.toml +++ b/gix-hash/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-hash" version = "0.14.2" diff --git a/gix-hashtable/Cargo.toml b/gix-hashtable/Cargo.toml index 3a057602c94..aa16ae17949 100644 --- a/gix-hashtable/Cargo.toml +++ b/gix-hashtable/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-hashtable" version = "0.5.2" @@ -15,8 +17,7 @@ doctest = false [dependencies] parking_lot = "0.12.1" hashbrown = { version = "0.14.0", default-features = false, features = [ - "inline-more", - "raw" + "inline-more", + "raw" ] } gix-hash = { version = "^0.14.2", path = "../gix-hash" } - diff --git a/gix-ignore/Cargo.toml b/gix-ignore/Cargo.toml index 172dc8c558d..fe6d4c8c140 100644 --- a/gix-ignore/Cargo.toml +++ b/gix-ignore/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-ignore" version = "0.11.4" diff --git a/gix-index/Cargo.toml b/gix-index/Cargo.toml index a05b87bbd98..4515d9ef26c 100644 --- a/gix-index/Cargo.toml +++ b/gix-index/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-index" version = "0.35.0" diff --git a/gix-index/tests/Cargo.toml b/gix-index/tests/Cargo.toml index 8e5700826f5..7d390b56ba8 100644 --- a/gix-index/tests/Cargo.toml +++ b/gix-index/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-index-tests" version = "0.0.0" diff --git a/gix-lfs/Cargo.toml b/gix-lfs/Cargo.toml index 348f6b5408c..9948bf9d606 100644 --- a/gix-lfs/Cargo.toml +++ b/gix-lfs/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-lfs" version = "0.0.0" diff --git a/gix-lock/Cargo.toml b/gix-lock/Cargo.toml index ad769a9e102..be07eb062ba 100644 --- a/gix-lock/Cargo.toml +++ b/gix-lock/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-lock" version = "14.0.0" diff --git a/gix-macros/Cargo.toml b/gix-macros/Cargo.toml index 78849181bc1..483f59e6004 100644 --- a/gix-macros/Cargo.toml +++ b/gix-macros/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-macros" version = "0.1.5" diff --git a/gix-mailmap/Cargo.toml b/gix-mailmap/Cargo.toml index 6756b450d6b..b0f114d6a9d 100644 --- a/gix-mailmap/Cargo.toml +++ b/gix-mailmap/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-mailmap" version = "0.24.0" diff --git a/gix-negotiate/Cargo.toml b/gix-negotiate/Cargo.toml index 87764485e65..18d56853ede 100644 --- a/gix-negotiate/Cargo.toml +++ b/gix-negotiate/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-negotiate" version = "0.15.0" diff --git a/gix-note/Cargo.toml b/gix-note/Cargo.toml index c6e1a10ed72..8cc465e563e 100644 --- a/gix-note/Cargo.toml +++ b/gix-note/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-note" version = "0.0.0" diff --git a/gix-object/Cargo.toml b/gix-object/Cargo.toml index 93b90803d33..f3047525668 100644 --- a/gix-object/Cargo.toml +++ b/gix-object/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-object" version = "0.44.0" diff --git a/gix-object/fuzz/Cargo.toml b/gix-object/fuzz/Cargo.toml index 1699c38890f..47c768b6e67 100644 --- a/gix-object/fuzz/Cargo.toml +++ b/gix-object/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-object-fuzz" version = "0.0.0" diff --git a/gix-odb/Cargo.toml b/gix-odb/Cargo.toml index f2b8544492f..ce87448814c 100644 --- a/gix-odb/Cargo.toml +++ b/gix-odb/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-odb" version = "0.63.0" diff --git a/gix-odb/tests/Cargo.toml b/gix-odb/tests/Cargo.toml index d42d1775af6..b267e6ec50c 100644 --- a/gix-odb/tests/Cargo.toml +++ b/gix-odb/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-odb-tests" version = "0.0.0" @@ -30,4 +32,3 @@ pretty_assertions = "1.0.0" filetime = "0.2.15" maplit = "1.0.2" crossbeam-channel = "0.5.13" - diff --git a/gix-pack/Cargo.toml b/gix-pack/Cargo.toml index a3a4fa301d7..313a298eda8 100644 --- a/gix-pack/Cargo.toml +++ b/gix-pack/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-pack" version = "0.53.0" @@ -61,7 +63,7 @@ document-features = { version = "0.2.0", optional = true } gix-tempfile = { version = "^14.0.0", default-features = false, path = "../gix-tempfile", optional = true } [dev-dependencies] -gix-testtools = { path = "../tests/tools"} +gix-testtools = { path = "../tests/tools" } [package.metadata.docs.rs] all-features = true diff --git a/gix-pack/tests/Cargo.toml b/gix-pack/tests/Cargo.toml index d5da0761c41..b82af06be98 100644 --- a/gix-pack/tests/Cargo.toml +++ b/gix-pack/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-pack-tests" version = "0.0.0" @@ -19,11 +21,11 @@ path = "integrate.rs" [dev-dependencies] gix-pack = { path = "..", features = ["generate", "streaming-input"] } gix-features = { path = "../../gix-features" } -gix-testtools = { path = "../../tests/tools"} +gix-testtools = { path = "../../tests/tools" } gix-odb = { path = "../../gix-odb" } bstr = { version = "1.3.0", default-features = false, features = ["std"] } maplit = "1.0.2" -gix-object = { path = "../../gix-object" } -gix-traverse = { path = "../../gix-traverse" } -gix-hash = { path = "../../gix-hash" } +gix-object = { path = "../../gix-object" } +gix-traverse = { path = "../../gix-traverse" } +gix-hash = { path = "../../gix-hash" } memmap2 = "0.9.0" diff --git a/gix-packetline-blocking/Cargo.toml b/gix-packetline-blocking/Cargo.toml index fa1a22922dc..6b2a1146933 100644 --- a/gix-packetline-blocking/Cargo.toml +++ b/gix-packetline-blocking/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-packetline-blocking" version = "0.17.5" diff --git a/gix-packetline/Cargo.toml b/gix-packetline/Cargo.toml index 8c4432c00b9..a9f395264b6 100644 --- a/gix-packetline/Cargo.toml +++ b/gix-packetline/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-packetline" version = "0.17.6" diff --git a/gix-path/Cargo.toml b/gix-path/Cargo.toml index eca6a8b6baf..ccadfacdff4 100644 --- a/gix-path/Cargo.toml +++ b/gix-path/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-path" version = "0.10.10" diff --git a/gix-pathspec/Cargo.toml b/gix-pathspec/Cargo.toml index d010e350299..7836fb52b3a 100644 --- a/gix-pathspec/Cargo.toml +++ b/gix-pathspec/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-pathspec" version = "0.7.7" diff --git a/gix-pathspec/fuzz/Cargo.toml b/gix-pathspec/fuzz/Cargo.toml index e1d3e3e3d08..a70e58e03e1 100644 --- a/gix-pathspec/fuzz/Cargo.toml +++ b/gix-pathspec/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-pathspec-fuzz" version = "0.0.0" diff --git a/gix-prompt/Cargo.toml b/gix-prompt/Cargo.toml index 8999a98d090..6f1b6288c66 100644 --- a/gix-prompt/Cargo.toml +++ b/gix-prompt/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-prompt" version = "0.8.7" diff --git a/gix-protocol/Cargo.toml b/gix-protocol/Cargo.toml index dada295809b..994bc82f167 100644 --- a/gix-protocol/Cargo.toml +++ b/gix-protocol/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-protocol" version = "0.45.3" diff --git a/gix-quote/Cargo.toml b/gix-quote/Cargo.toml index 2b4124c0a08..241a7f1d929 100644 --- a/gix-quote/Cargo.toml +++ b/gix-quote/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-quote" version = "0.4.12" diff --git a/gix-rebase/Cargo.toml b/gix-rebase/Cargo.toml index 21bf5590b48..38b2abd323a 100644 --- a/gix-rebase/Cargo.toml +++ b/gix-rebase/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-rebase" version = "0.0.0" diff --git a/gix-ref/Cargo.toml b/gix-ref/Cargo.toml index d446ddb96e6..6e2263e8865 100644 --- a/gix-ref/Cargo.toml +++ b/gix-ref/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-ref" version = "0.47.0" diff --git a/gix-ref/fuzz/Cargo.toml b/gix-ref/fuzz/Cargo.toml index 268e1967edb..63fccf85e78 100644 --- a/gix-ref/fuzz/Cargo.toml +++ b/gix-ref/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-ref-fuzz" version = "0.0.0" diff --git a/gix-ref/tests/Cargo.toml b/gix-ref/tests/Cargo.toml index 1bb2fdc559c..e33d7d7b46c 100644 --- a/gix-ref/tests/Cargo.toml +++ b/gix-ref/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-ref-tests" version = "0.0.0" @@ -20,7 +22,7 @@ path = "refs.rs" [dev-dependencies] gix-ref = { path = ".." } gix-fs = { path = "../../gix-fs" } -gix-features = { path = "../../gix-features", features = ["walkdir"]} +gix-features = { path = "../../gix-features", features = ["walkdir"] } gix-testtools = { path = "../../tests/tools" } gix-discover = { path = "../../gix-discover" } gix-odb = { path = "../../gix-odb" } diff --git a/gix-refspec/Cargo.toml b/gix-refspec/Cargo.toml index 42ba99951d2..5c9af48310e 100644 --- a/gix-refspec/Cargo.toml +++ b/gix-refspec/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-refspec" version = "0.25.0" @@ -17,7 +19,7 @@ gix-revision = { version = "^0.29.0", path = "../gix-revision", default-features gix-validate = { version = "^0.9.0", path = "../gix-validate" } gix-hash = { version = "^0.14.2", path = "../gix-hash" } -bstr = { version = "1.3.0", default-features = false, features = ["std"]} +bstr = { version = "1.3.0", default-features = false, features = ["std"] } thiserror = "1.0.26" smallvec = "1.9.0" diff --git a/gix-refspec/fuzz/Cargo.toml b/gix-refspec/fuzz/Cargo.toml index 5297c069062..f54401cc724 100644 --- a/gix-refspec/fuzz/Cargo.toml +++ b/gix-refspec/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-refspec-fuzz" version = "0.0.0" diff --git a/gix-revision/Cargo.toml b/gix-revision/Cargo.toml index b5fb9ad0729..4a423a13961 100644 --- a/gix-revision/Cargo.toml +++ b/gix-revision/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-revision" version = "0.29.0" diff --git a/gix-revision/fuzz/Cargo.toml b/gix-revision/fuzz/Cargo.toml index e6ef0c1461d..3264acdd8ac 100644 --- a/gix-revision/fuzz/Cargo.toml +++ b/gix-revision/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-revision-fuzz" version = "0.0.0" diff --git a/gix-revwalk/Cargo.toml b/gix-revwalk/Cargo.toml index 324c53b0b13..2eddc041690 100644 --- a/gix-revwalk/Cargo.toml +++ b/gix-revwalk/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-revwalk" version = "0.15.0" diff --git a/gix-sec/Cargo.toml b/gix-sec/Cargo.toml index 82160f3710a..53fa0be6e8a 100644 --- a/gix-sec/Cargo.toml +++ b/gix-sec/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-sec" version = "0.10.8" diff --git a/gix-sequencer/Cargo.toml b/gix-sequencer/Cargo.toml index 071cc463fa9..785e75ad9da 100644 --- a/gix-sequencer/Cargo.toml +++ b/gix-sequencer/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-sequencer" version = "0.0.0" diff --git a/gix-status/Cargo.toml b/gix-status/Cargo.toml index 53c71a98983..f1faa97b31e 100644 --- a/gix-status/Cargo.toml +++ b/gix-status/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-status" version = "0.13.0" diff --git a/gix-status/tests/Cargo.toml b/gix-status/tests/Cargo.toml index 576a81829c4..a9aec0aaeec 100644 --- a/gix-status/tests/Cargo.toml +++ b/gix-status/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-status-tests" version = "0.0.0" diff --git a/gix-submodule/Cargo.toml b/gix-submodule/Cargo.toml index e049f3509c8..d4ac5e1dd84 100644 --- a/gix-submodule/Cargo.toml +++ b/gix-submodule/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-submodule" version = "0.14.0" @@ -23,6 +25,5 @@ bstr = { version = "1.5.0", default-features = false } thiserror = "1.0.44" [dev-dependencies] -gix-testtools = { path = "../tests/tools"} +gix-testtools = { path = "../tests/tools" } gix-features = { path = "../gix-features", features = ["walkdir"] } - diff --git a/gix-tempfile/Cargo.toml b/gix-tempfile/Cargo.toml index 0052a6598fb..fa5d75d01c9 100644 --- a/gix-tempfile/Cargo.toml +++ b/gix-tempfile/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-tempfile" version = "14.0.2" @@ -54,4 +56,3 @@ libc = { version = "0.2.98", default-features = false } [package.metadata.docs.rs] all-features = true features = ["document-features"] - diff --git a/gix-tix/Cargo.toml b/gix-tix/Cargo.toml index 7024a0f8699..35e0281ff7c 100644 --- a/gix-tix/Cargo.toml +++ b/gix-tix/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-tix" version = "0.0.0" diff --git a/gix-trace/Cargo.toml b/gix-trace/Cargo.toml index 47b389caddc..e3cd897bddc 100644 --- a/gix-trace/Cargo.toml +++ b/gix-trace/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-trace" description = "A crate to provide minimal `tracing` support that can be turned off to zero cost" @@ -22,10 +24,10 @@ default = [] ## ## Note that this may have overhead as well, thus instrumentations should be used stategically, only providing coarse tracing by default and adding details ## only where needed while marking them with the appropriate level. -tracing = [ "dep:tracing-core" ] +tracing = ["dep:tracing-core"] ## If enabled, detailed tracing is also emitted, which can greatly increase insights but at a cost. -tracing-detail = [ ] +tracing-detail = [] [dependencies] diff --git a/gix-transport/Cargo.toml b/gix-transport/Cargo.toml index 7e53c15cdda..b824e57813f 100644 --- a/gix-transport/Cargo.toml +++ b/gix-transport/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-transport" version = "0.42.3" diff --git a/gix-traverse/Cargo.toml b/gix-traverse/Cargo.toml index b58e667072f..75a95ff6d8b 100644 --- a/gix-traverse/Cargo.toml +++ b/gix-traverse/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-traverse" version = "0.41.0" diff --git a/gix-traverse/tests/Cargo.toml b/gix-traverse/tests/Cargo.toml index 053683f7be7..ea5a5ec5505 100644 --- a/gix-traverse/tests/Cargo.toml +++ b/gix-traverse/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-traverse-tests" version = "0.0.0" @@ -9,7 +11,7 @@ edition = "2021" rust-version = "1.65" [[test]] -name ="test" +name = "test" path = "traverse.rs" [dev-dependencies] diff --git a/gix-tui/Cargo.toml b/gix-tui/Cargo.toml index fd2a126505f..20819f3d8f1 100644 --- a/gix-tui/Cargo.toml +++ b/gix-tui/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-tui" version = "0.0.0" diff --git a/gix-url/Cargo.toml b/gix-url/Cargo.toml index f1328c791d1..e8a43a65336 100644 --- a/gix-url/Cargo.toml +++ b/gix-url/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-url" version = "0.27.5" diff --git a/gix-url/fuzz/Cargo.toml b/gix-url/fuzz/Cargo.toml index 5a6a5e0a886..6d243af334e 100644 --- a/gix-url/fuzz/Cargo.toml +++ b/gix-url/fuzz/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-url-fuzz" version = "0.0.0" diff --git a/gix-utils/Cargo.toml b/gix-utils/Cargo.toml index 134e470c22c..f5a12b9550a 100644 --- a/gix-utils/Cargo.toml +++ b/gix-utils/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-utils" version = "0.1.12" @@ -19,4 +21,3 @@ bstr = ["dep:bstr"] fastrand = "2.0.0" bstr = { version = "1.5.0", default-features = false, features = ["std"], optional = true } unicode-normalization = { version = "0.1.19", default-features = false } - diff --git a/gix-validate/Cargo.toml b/gix-validate/Cargo.toml index 796d479eda6..f07afc15f77 100644 --- a/gix-validate/Cargo.toml +++ b/gix-validate/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-validate" version = "0.9.0" diff --git a/gix-worktree-state/Cargo.toml b/gix-worktree-state/Cargo.toml index 0681348e28a..483f5921536 100644 --- a/gix-worktree-state/Cargo.toml +++ b/gix-worktree-state/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-worktree-state" version = "0.13.0" diff --git a/gix-worktree-state/tests/Cargo.toml b/gix-worktree-state/tests/Cargo.toml index 9cabe4709dc..763b11bc0cb 100644 --- a/gix-worktree-state/tests/Cargo.toml +++ b/gix-worktree-state/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-worktree-state-tests" version = "0.0.0" diff --git a/gix-worktree-stream/Cargo.toml b/gix-worktree-stream/Cargo.toml index e2a40d55f0d..e0c208934c6 100644 --- a/gix-worktree-stream/Cargo.toml +++ b/gix-worktree-stream/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-worktree-stream" version = "0.15.0" @@ -26,6 +28,6 @@ thiserror = "1.0.26" parking_lot = "0.12.1" [dev-dependencies] -gix-testtools = { path = "../tests/tools"} -gix-odb = { path = "../gix-odb"} -gix-worktree = { path = "../gix-worktree", default-features = false, features = ["attributes"]} +gix-testtools = { path = "../tests/tools" } +gix-odb = { path = "../gix-odb" } +gix-worktree = { path = "../gix-worktree", default-features = false, features = ["attributes"] } diff --git a/gix-worktree/Cargo.toml b/gix-worktree/Cargo.toml index d047256787f..a3bd311ccc9 100644 --- a/gix-worktree/Cargo.toml +++ b/gix-worktree/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-worktree" version = "0.36.0" diff --git a/gix-worktree/tests/Cargo.toml b/gix-worktree/tests/Cargo.toml index 227ee3e36b4..27697c7d2a2 100644 --- a/gix-worktree/tests/Cargo.toml +++ b/gix-worktree/tests/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-worktree-tests" version = "0.0.0" diff --git a/gix/Cargo.toml b/gix/Cargo.toml index ab05511ef09..92ce0727a00 100644 --- a/gix/Cargo.toml +++ b/gix/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix" repository = "https://github.com/Byron/gitoxide" diff --git a/tests/it/Cargo.toml b/tests/it/Cargo.toml index 2f76f9fadb5..57a019e0cdd 100644 --- a/tests/it/Cargo.toml +++ b/tests/it/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "internal-tools" description = "internal CLI tooling to help generated test-cases" @@ -16,4 +18,3 @@ clap = { version = "4.5.16", features = ["derive"] } anyhow = "1.0.86" gix = { version = "^0.66.0", path = "../../gix", default-features = false, features = ["attributes", "revision"] } - diff --git a/tests/tools/Cargo.toml b/tests/tools/Cargo.toml index f0054284e3e..5ac8e9f7445 100644 --- a/tests/tools/Cargo.toml +++ b/tests/tools/Cargo.toml @@ -1,3 +1,5 @@ +lints.workspace = true + [package] name = "gix-testtools" description = "Shared code for gitoxide crates to facilitate testing" From 7b6e1764dc3b1dad30738fcb16b7428d880d4203 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 24 Aug 2024 10:07:51 -0400 Subject: [PATCH 2/5] lint fix, just file adjustment --- gix-features/src/hash.rs | 2 +- justfile | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gix-features/src/hash.rs b/gix-features/src/hash.rs index df04db0716f..4c5389fad1c 100644 --- a/gix-features/src/hash.rs +++ b/gix-features/src/hash.rs @@ -14,7 +14,7 @@ mod _impl { impl Sha1 { /// Digest the given `bytes`. pub fn update(&mut self, bytes: &[u8]) { - self.0.update(bytes) + self.0.update(bytes); } /// Finalize the hash and produce a digest. pub fn digest(self) -> Sha1Digest { diff --git a/justfile b/justfile index c269f9e9b34..9109d8a284f 100755 --- a/justfile +++ b/justfile @@ -24,17 +24,17 @@ clear-target: # Run cargo clippy on all crates clippy *clippy-args: - cargo clippy --all --tests --examples --benches -- {{ clippy-args }} - cargo clippy --all --no-default-features --features small -- {{ clippy-args }} - cargo clippy --all --no-default-features --features max-pure -- {{ clippy-args }} - cargo clippy --all --no-default-features --features lean-async --tests -- {{ clippy-args }} + cargo clippy --workspace --all-targets -- {{ clippy-args }} + cargo clippy --workspace --no-default-features --features small -- {{ clippy-args }} + cargo clippy --workspace --no-default-features --features max-pure -- {{ clippy-args }} + cargo clippy --workspace --no-default-features --features lean-async --tests -- {{ clippy-args }} # Run cargo clippy on all crates, fixing what can be fixed, and format all code clippy-fix: - cargo clippy --fix --all --tests --examples - cargo clippy --fix --allow-dirty --all --no-default-features --features small - cargo clippy --fix --allow-dirty --all --no-default-features --features max-pure - cargo clippy --fix --allow-dirty --all --no-default-features --features lean-async --tests + cargo clippy --fix --workspace --all-targets + cargo clippy --fix --allow-dirty --workspace --no-default-features --features small + cargo clippy --fix --allow-dirty --workspace --no-default-features --features max-pure + cargo clippy --fix --allow-dirty --workspace --no-default-features --features lean-async --tests cargo fmt --all # Build all code in suitable configurations From fc45c931c132ac8b6ea4f2e4c3d5f0d19727f46f Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 24 Aug 2024 10:22:24 -0400 Subject: [PATCH 3/5] a few more missing semicolons --- gix-features/tests/hash.rs | 2 +- gix-packetline/src/encode/async_io.rs | 10 +++++----- gix-packetline/src/read/sidebands/async_io.rs | 2 +- gix-packetline/src/write/async_io.rs | 2 +- gix-packetline/tests/read/sideband.rs | 2 +- gix-protocol/src/handshake/refs/tests.rs | 2 +- gix-transport/src/client/async_io/bufread_ext.rs | 6 +++--- gix/tests/repository/config/transport_options.rs | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gix-features/tests/hash.rs b/gix-features/tests/hash.rs index 17e368af39e..4cccdd77043 100644 --- a/gix-features/tests/hash.rs +++ b/gix-features/tests/hash.rs @@ -3,7 +3,7 @@ use gix_features::hash::Sha1; #[cfg(not(feature = "fast-sha1"))] #[test] fn size_of_sha1() { - assert_eq!(std::mem::size_of::(), 96) + assert_eq!(std::mem::size_of::(), 96); } #[cfg(feature = "fast-sha1")] diff --git a/gix-packetline/src/encode/async_io.rs b/gix-packetline/src/encode/async_io.rs index 01487e8d4e9..57b379225a8 100644 --- a/gix-packetline/src/encode/async_io.rs +++ b/gix-packetline/src/encode/async_io.rs @@ -70,7 +70,7 @@ impl AsyncWrite for LineWriter<'_, W> { } let data_len = data_len + 4; let len_buf = u16_to_hex(data_len as u16); - *this.state = State::WriteHexLen(len_buf, 0) + *this.state = State::WriteHexLen(len_buf, 0); } State::WriteHexLen(hex_len, written) => { while *written != hex_len.len() { @@ -81,9 +81,9 @@ impl AsyncWrite for LineWriter<'_, W> { *written += n; } if this.prefix.is_empty() { - *this.state = State::WriteData(0) + *this.state = State::WriteData(0); } else { - *this.state = State::WritePrefix(this.prefix) + *this.state = State::WritePrefix(this.prefix); } } State::WritePrefix(buf) => { @@ -95,7 +95,7 @@ impl AsyncWrite for LineWriter<'_, W> { let (_, rest) = std::mem::take(buf).split_at(n); *buf = rest; } - *this.state = State::WriteData(0) + *this.state = State::WriteData(0); } State::WriteData(written) => { while *written != data.len() { @@ -110,7 +110,7 @@ impl AsyncWrite for LineWriter<'_, W> { *this.state = State::Idle; return Poll::Ready(Ok(written)); } else { - *this.state = State::WriteSuffix(this.suffix) + *this.state = State::WriteSuffix(this.suffix); } } State::WriteSuffix(buf) => { diff --git a/gix-packetline/src/read/sidebands/async_io.rs b/gix-packetline/src/read/sidebands/async_io.rs index e93b0b93592..974bac9597b 100644 --- a/gix-packetline/src/read/sidebands/async_io.rs +++ b/gix-packetline/src/read/sidebands/async_io.rs @@ -106,7 +106,7 @@ where parent .as_mut() .expect("parent is always available if we are idle") - .reset_with(delimiters) + .reset_with(delimiters); } } diff --git a/gix-packetline/src/write/async_io.rs b/gix-packetline/src/write/async_io.rs index 19eaac16ce1..35b93012675 100644 --- a/gix-packetline/src/write/async_io.rs +++ b/gix-packetline/src/write/async_io.rs @@ -68,7 +68,7 @@ impl AsyncWrite for Writer { "empty packet lines are not permitted as '0004' is invalid", ))); } - *this.state = State::WriteData(0) + *this.state = State::WriteData(0); } State::WriteData(written) => { while *written != buf.len() { diff --git a/gix-packetline/tests/read/sideband.rs b/gix-packetline/tests/read/sideband.rs index 0739812bb56..c5f33e93979 100644 --- a/gix-packetline/tests/read/sideband.rs +++ b/gix-packetline/tests/read/sideband.rs @@ -30,7 +30,7 @@ mod util { } fn consume(&mut self, amt: usize) { - Pin::new(&mut self.0).consume(amt) + Pin::new(&mut self.0).consume(amt); } } } diff --git a/gix-protocol/src/handshake/refs/tests.rs b/gix-protocol/src/handshake/refs/tests.rs index 61ef1b07b31..7b69e6eca4a 100644 --- a/gix-protocol/src/handshake/refs/tests.rs +++ b/gix-protocol/src/handshake/refs/tests.rs @@ -226,7 +226,7 @@ impl<'a> futures_io::AsyncBufRead for Fixture<'a> { } fn consume(self: std::pin::Pin<&mut Self>, amt: usize) { - self.project_inner().consume(amt) + self.project_inner().consume(amt); } } diff --git a/gix-transport/src/client/async_io/bufread_ext.rs b/gix-transport/src/client/async_io/bufread_ext.rs index 2f868ca2e88..0d32c4005a0 100644 --- a/gix-transport/src/client/async_io/bufread_ext.rs +++ b/gix-transport/src/client/async_io/bufread_ext.rs @@ -72,7 +72,7 @@ impl<'a, T: ReadlineBufRead + ?Sized + 'a + Unpin> ReadlineBufRead for Box { #[async_trait(?Send)] impl<'a, T: ExtendedBufRead<'a> + ?Sized + 'a + Unpin> ExtendedBufRead<'a> for Box { fn set_progress_handler(&mut self, handle_progress: Option>) { - self.deref_mut().set_progress_handler(handle_progress) + self.deref_mut().set_progress_handler(handle_progress); } async fn peek_data_line(&mut self) -> Option>> { @@ -80,7 +80,7 @@ impl<'a, T: ExtendedBufRead<'a> + ?Sized + 'a + Unpin> ExtendedBufRead<'a> for B } fn reset(&mut self, version: Protocol) { - self.deref_mut().reset(version) + self.deref_mut().reset(version); } fn stopped_at(&self) -> Option { @@ -113,7 +113,7 @@ impl<'a, T: AsyncRead + Unpin> ReadlineBufRead for gix_packetline::read::WithSid #[async_trait(?Send)] impl<'a, T: AsyncRead + Unpin> ExtendedBufRead<'a> for gix_packetline::read::WithSidebands<'a, T, HandleProgress<'a>> { fn set_progress_handler(&mut self, handle_progress: Option>) { - self.set_progress_handler(handle_progress) + self.set_progress_handler(handle_progress); } async fn peek_data_line(&mut self) -> Option>> { match self.peek_data_line().await { diff --git a/gix/tests/repository/config/transport_options.rs b/gix/tests/repository/config/transport_options.rs index ae96d6a3ff6..6d5328936f0 100644 --- a/gix/tests/repository/config/transport_options.rs +++ b/gix/tests/repository/config/transport_options.rs @@ -83,7 +83,7 @@ mod http { assert!( backend.is_none(), "backed is never set as it's backend specific, rather custom options typically" - ) + ); } #[cfg(feature = "blocking-http-transport-curl")] { From 05268eb9b41322041dace244cd24460ab2f9f081 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Sat, 24 Aug 2024 10:44:00 -0400 Subject: [PATCH 4/5] run `just copy-packetline` (missing docs?) --- gix-packetline-blocking/src/encode/async_io.rs | 10 +++++----- gix-packetline-blocking/src/read/sidebands/async_io.rs | 2 +- gix-packetline-blocking/src/write/async_io.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gix-packetline-blocking/src/encode/async_io.rs b/gix-packetline-blocking/src/encode/async_io.rs index 384ec856f5e..fbf734b685c 100644 --- a/gix-packetline-blocking/src/encode/async_io.rs +++ b/gix-packetline-blocking/src/encode/async_io.rs @@ -72,7 +72,7 @@ impl AsyncWrite for LineWriter<'_, W> { } let data_len = data_len + 4; let len_buf = u16_to_hex(data_len as u16); - *this.state = State::WriteHexLen(len_buf, 0) + *this.state = State::WriteHexLen(len_buf, 0); } State::WriteHexLen(hex_len, written) => { while *written != hex_len.len() { @@ -83,9 +83,9 @@ impl AsyncWrite for LineWriter<'_, W> { *written += n; } if this.prefix.is_empty() { - *this.state = State::WriteData(0) + *this.state = State::WriteData(0); } else { - *this.state = State::WritePrefix(this.prefix) + *this.state = State::WritePrefix(this.prefix); } } State::WritePrefix(buf) => { @@ -97,7 +97,7 @@ impl AsyncWrite for LineWriter<'_, W> { let (_, rest) = std::mem::take(buf).split_at(n); *buf = rest; } - *this.state = State::WriteData(0) + *this.state = State::WriteData(0); } State::WriteData(written) => { while *written != data.len() { @@ -112,7 +112,7 @@ impl AsyncWrite for LineWriter<'_, W> { *this.state = State::Idle; return Poll::Ready(Ok(written)); } else { - *this.state = State::WriteSuffix(this.suffix) + *this.state = State::WriteSuffix(this.suffix); } } State::WriteSuffix(buf) => { diff --git a/gix-packetline-blocking/src/read/sidebands/async_io.rs b/gix-packetline-blocking/src/read/sidebands/async_io.rs index 0582ea11ed8..848ab23b140 100644 --- a/gix-packetline-blocking/src/read/sidebands/async_io.rs +++ b/gix-packetline-blocking/src/read/sidebands/async_io.rs @@ -108,7 +108,7 @@ where parent .as_mut() .expect("parent is always available if we are idle") - .reset_with(delimiters) + .reset_with(delimiters); } } diff --git a/gix-packetline-blocking/src/write/async_io.rs b/gix-packetline-blocking/src/write/async_io.rs index 7b76c011fa9..6684ab19fd8 100644 --- a/gix-packetline-blocking/src/write/async_io.rs +++ b/gix-packetline-blocking/src/write/async_io.rs @@ -70,7 +70,7 @@ impl AsyncWrite for Writer { "empty packet lines are not permitted as '0004' is invalid", ))); } - *this.state = State::WriteData(0) + *this.state = State::WriteData(0); } State::WriteData(written) => { while *written != buf.len() { From 7083b7acec599de893f87d4c876b9b392cdc2a2d Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 24 Aug 2024 19:19:54 +0200 Subject: [PATCH 5/5] remove custom `.cargo` configuration as it's superseded by Clippy workspace lints It was only needed to unify what Clippy does, but now there is better ways to do this. --- .cargo/config.toml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 87d8b21363d..00000000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,22 +0,0 @@ -[build] -rustflags = [ - # Rustc lints - # "-W", "warning_name" - - # Clippy lints - "-W", "clippy::cloned_instead_of_copied", - "-W", "clippy::map_unwrap_or", - "-W", "clippy::redundant_closure_for_method_calls", - "-W", "clippy::unnested_or_patterns", - "-W", "clippy::uninlined_format_args", - - # Rejected for now, and why - # "-W" "clippy::default_trait_access" - sometimes makes imports necessary, just for a default value. It's good for more explicit typing though. - # "-W" "clippy::range_plus_one" - useful, but caused too many false positives as we use range types directly quite a lot - # "-W", "clippy::explicit_iter_loop", - the cases I saw turned `foo.iter_mut()` into `&mut *foo` - - - # Rustdoc lints - # "-W", "rustdoc::warning_name" - # "-A", "rustdoc::warning_name" -]