This is an automated email from the ASF dual-hosted git repository.

Jefffrey pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 028793e794 Make clippy lints opt-out rather than opt-in (#10742)
028793e794 is described below

commit 028793e794a9bd65c9318b30568974639b203ab9
Author: Emil Ernerfeldt <[email protected]>
AuthorDate: Wed Aug 19 18:25:57 2026 -0700

    Make clippy lints opt-out rather than opt-in (#10742)
    
    # Which issue does this PR close?
    
    Follow-up to #10720 and #10721.
    
    # Rationale for this change
    
    We had 134 clippy lints spelled out one by one. Turning on the `all` and
    `pedantic` groups is shorter, and it means new lints are picked up
    automatically instead of needing another opt-in PR.
    
    # What changes are included in this PR?
    
    * `clippy::all` and `clippy::pedantic` are set to `warn` for the
    workspace
    * 77 explicit opt-ins are removed, since `pedantic` already covers them
    * the 51 `pedantic` lints we currently violate are set to `allow`, each
    with the current violation count so we know the size of the job if we
    want to turn one back on
    
    # Are these changes tested?
    
    `cargo clippy --all-features --all-targets -- -D warnings` is clean.
    
    # Are there any user-facing changes?
    
    No.
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
    Co-authored-by: Jeffrey Vo <[email protected]>
---
 Cargo.toml | 138 +++++++++++++++++++++++++++----------------------------------
 1 file changed, 60 insertions(+), 78 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index db77e7a890..df851b3ccb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -154,141 +154,123 @@ broken_intra_doc_links = "warn"
 missing_crate_level_docs = "warn"
 
 [workspace.lints.clippy]
+all = { level = "warn", priority = -1 }
+pedantic = { level = "warn", priority = -1 }
+
+# Extra lints on top of `all` and `pedantic`, mostly from the `restriction` and
+# `nursery` groups:
 allow_attributes = "warn"
 as_ptr_cast_mut = "warn"
-assigning_clones = "warn"
-bool_to_int_with_if = "warn"
 branches_sharing_code = "warn"
-checked_conversions = "warn"
 clear_with_drain = "warn"
-cloned_instead_of_copied = "warn"
 coerce_container_to_any = "warn"
-comparison_chain = "warn"
 dbg_macro = "warn"
 debug_assert_with_mut_call = "warn"
-decimal_bitwise_operands = "warn"
 default_union_representation = "warn"
 disallowed_script_idents = "warn"
-doc_broken_link = "warn"
-doc_comment_double_space_linebreaks = "warn"
 doc_include_without_cfg = "warn"
-doc_link_with_quotes = "warn"
-duration_suboptimal_units = "warn"
-elidable_lifetime_names = "warn"
 empty_enum_variants_with_brackets = "warn"
-empty_enums = "warn"
 equatable_if_let = "warn"
 exit = "warn"
-expl_impl_clone_on_copy = "warn"
-explicit_deref_methods = "warn"
-explicit_into_iter_loop = "warn"
-explicit_iter_loop = "warn"
-filter_map_next = "warn"
-flat_map_option = "warn"
 float_cmp_const = "warn"
-fn_params_excessive_bools = "warn"
 fn_to_numeric_cast_any = "warn"
-format_push_string = "warn"
-ignored_unit_patterns = "warn"
-implicit_clone = "warn"
 imprecise_flops = "warn"
-inconsistent_struct_constructor = "warn"
-index_refutable_slice = "warn"
-inefficient_to_string = "warn"
 infinite_loop = "warn"
-into_iter_without_iter = "warn"
-invalid_upcast_comparisons = "warn"
-ip_constant = "warn"
-iter_filter_is_ok = "warn"
-iter_filter_is_some = "warn"
-iter_not_returning_iterator = "warn"
 iter_on_empty_collections = "warn"
 iter_on_single_items = "warn"
 iter_with_drain = "warn"
-iter_without_into_iter = "warn"
-large_digit_groups = "warn"
-large_futures = "warn"
 large_include_file = "warn"
-large_stack_arrays = "warn"
 large_stack_frames = "warn"
-large_types_passed_by_value = "warn"
-linkedlist = "warn"
 literal_string_with_formatting_args = "warn"
 lossy_float_literal = "warn"
-macro_use_imports = "warn"
-manual_ilog2 = "warn"
-manual_instant_elapsed = "warn"
-manual_is_power_of_two = "warn"
-manual_is_variant_and = "warn"
-manual_let_else = "warn"
-manual_midpoint = "warn"
-manual_string_new = "warn"
-match_wild_err_arm = "warn"
-match_wildcard_for_single_variants = "warn"
-mismatching_type_param_order = "warn"
-mut_mut = "warn"
 mutex_integer = "warn"
-needless_continue = "warn"
 needless_pass_by_ref_mut = "warn"
-needless_raw_string_hashes = "warn"
 needless_type_cast = "warn"
 negative_feature_names = "warn"
 non_zero_suggestions = "warn"
 nonstandard_macro_braces = "warn"
-option_as_ref_cloned = "warn"
-option_option = "warn"
 or_fun_call = "warn"
 path_buf_push_overwrite = "warn"
 pathbuf_init_then_push = "warn"
 precedence_bits = "warn"
-ptr_as_ptr = "warn"
-ptr_cast_constness = "warn"
-ptr_offset_by_literal = "warn"
 pub_without_shorthand = "warn"
 rc_mutex = "warn"
 redundant_type_annotations = "warn"
-ref_as_ptr = "warn"
-ref_binding_to_reference = "warn"
-ref_option = "warn"
-ref_option_ref = "warn"
 rest_pat_in_fully_bound_structs = "warn"
 return_and_then = "warn"
-same_functions_in_if_condition = "warn"
-same_length_and_capacity = "warn"
-self_only_used_in_recursion = "warn"
 set_contains_or_insert = "warn"
-should_panic_without_expect = "warn"
-single_char_pattern = "warn"
 single_option_map = "warn"
-stable_sort_primitive = "warn"
-str_split_at_newline = "warn"
-string_add_assign = "warn"
 string_lit_as_bytes = "warn"
 string_lit_chars_any = "warn"
 suspicious_xor_used_as_pow = "warn"
 todo = "warn"
 trailing_empty_array = "warn"
 trait_duplication_in_bounds = "warn"
-transmute_ptr_to_ptr = "warn"
 tuple_array_conversions = "warn"
-unchecked_time_subtraction = "warn"
 uninhabited_references = "warn"
-uninlined_format_args = "warn"
-unnecessary_box_returns = "warn"
-unnecessary_literal_bound = "warn"
 unnecessary_safety_doc = "warn"
 unnecessary_self_imports = "warn"
-unnecessary_semicolon = "warn"
 unnecessary_struct_initialization = "warn"
-unnecessary_trailing_comma = "warn"
-unnested_or_patterns = "warn"
-unused_async = "warn"
 unused_peekable = "warn"
 unused_rounding = "warn"
 useless_let_if_seq = "warn"
 verbose_file_reads = "warn"
 wildcard_dependencies = "warn"
-zero_sized_map_values = "warn"
+
+# Lints in `pedantic` that we currently allow.
+# Some of these we should consider enabling in the future.
+# Counts come from `cargo clippy --all-features --all-targets`.
+borrow_as_ptr = "allow"                      # ~9 violations in ~1 file
+cast_lossless = "allow"                      # ~640 violations in ~100 files
+cast_possible_truncation = "allow"           # ~890 violations in ~190 files
+cast_possible_wrap = "allow"                 # ~570 violations in ~120 files
+cast_precision_loss = "allow"                # ~130 violations in ~33 files
+cast_ptr_alignment = "allow"                 # ~3 violations in ~3 files
+cast_sign_loss = "allow"                     # ~590 violations in ~150 files
+default_trait_access = "allow"               # ~210 violations in ~68 files
+doc_markdown = "allow"                       # ~2300 violations in ~290 files
+enum_glob_use = "allow"                      # ~65 violations in ~22 files
+float_cmp = "allow"                          # ~180 violations in ~2 files
+from_iter_instead_of_collect = "allow"       # ~200 violations in ~53 files
+if_not_else = "allow"                        # ~57 violations in ~39 files
+ignore_without_reason = "allow"              # ~16 violations in ~2 files
+implicit_hasher = "allow"                    # ~9 violations in ~4 files
+inline_always = "allow"                      # ~30 violations in ~17 files
+items_after_statements = "allow"             # ~130 violations in ~41 files
+manual_assert = "allow"                      # ~20 violations in ~12 files
+manual_assert_eq = "allow"                   # ~29 violations in ~10 files
+many_single_char_names = "allow"             # ~8 violations in ~5 files
+map_unwrap_or = "allow"                      # ~76 violations in ~40 files
+match_bool = "allow"                         # ~100 violations in ~49 files
+match_same_arms = "allow"                    # ~140 violations in ~49 files
+missing_errors_doc = "allow"                 # ~670 violations in ~170 files
+missing_fields_in_debug = "allow"            # ~14 violations in ~12 files
+missing_panics_doc = "allow"                 # ~140 violations in ~79 files
+must_use_candidate = "allow"                 # ~1700 violations in ~200 files
+needless_bitwise_bool = "allow"              # ~5 violations in ~3 files
+needless_for_each = "allow"                  # ~67 violations in ~28 files
+needless_pass_by_value = "allow"             # ~260 violations in ~110 files
+non_std_lazy_statics = "allow"               # ~56 violations in ~10 files
+range_plus_one = "allow"                     # ~17 violations in ~13 files
+redundant_closure_for_method_calls = "allow" # ~310 violations in ~130 files
+redundant_else = "allow"                     # ~23 violations in ~16 files
+return_self_not_must_use = "allow"           # ~470 violations in ~91 files
+semicolon_if_nothing_returned = "allow"      # ~1300 violations in ~250 files
+similar_names = "allow"                      # ~150 violations in ~43 files
+single_match_else = "allow"                  # ~63 violations in ~49 files
+struct_excessive_bools = "allow"             # ~4 violations in ~3 files
+struct_field_names = "allow"                 # ~18 violations in ~13 files
+too_many_lines = "allow"                     # ~220 violations in ~110 files
+trivially_copy_pass_by_ref = "allow"         # ~42 violations in ~17 files
+unicode_not_nfc = "allow"                    # ~13 violations in ~1 file
+unnecessary_debug_formatting = "allow"       # ~23 violations in ~7 files
+unnecessary_wraps = "allow"                  # ~64 violations in ~39 files
+unreadable_literal = "allow"                 # ~4100 violations in ~120 files
+unused_self = "allow"                        # ~31 violations in ~20 files
+used_underscore_binding = "allow"            # ~15 violations in ~3 files
+used_underscore_items = "allow"              # ~120 violations in ~17 files
+verbose_bit_mask = "allow"                   # 1 violation in 1 file
+wildcard_imports = "allow"                   # ~230 violations in ~130 files
 
 # release inherited profile keeping debug information and symbols
 # for mem/cpu profiling

Reply via email to