@@ -65,3 +65,47 @@ members = ["bitcoind-tests", "fuzz"]
6565
6666[lints .rust ]
6767unexpected_cfgs = { level = " deny" , check-cfg = [' cfg(miniscript_bench)' ] }
68+
69+ [lints .clippy ]
70+ # Exclude lints we don't think are valuable.
71+ needless_question_mark = " allow" # https://github.com/rust-bitcoin/rust-bitcoin/pull/2134
72+ manual_range_contains = " allow" # More readable than clippy's format.
73+ uninlined_format_args = " allow" # This is a subjective style choice.
74+ float_cmp = " allow" # Bitcoin floats are typically limited to 8 decimal places and we want them exact.
75+ match_bool = " allow" # Adds extra indentation and LOC.
76+ match_same_arms = " allow" # Collapses things that are conceptually unrelated to each other.
77+ must_use_candidate = " allow" # Useful for audit but many false positives.
78+ similar_names = " allow" # Too many (subjectively) false positives.
79+ # Exhaustive list of pedantic clippy lints
80+ assigning_clones = " warn"
81+ borrow_as_ptr = " warn"
82+ cast_lossless = " warn"
83+ cast_possible_truncation = " allow" # All casts should include a code comment (except test code).
84+ cast_possible_wrap = " allow" # Same as above re code comment.
85+ cast_precision_loss = " warn"
86+ cast_ptr_alignment = " warn"
87+ cast_sign_loss = " allow" # All casts should include a code comment (except in test code).
88+ invalid_upcast_comparisons = " warn"
89+ option_as_ref_cloned = " warn"
90+ ptr_as_ptr = " warn"
91+ ptr_cast_constness = " warn"
92+ ref_as_ptr = " warn"
93+ ref_binding_to_reference = " warn"
94+ ref_option_ref = " warn"
95+ same_functions_in_if_condition = " warn"
96+ should_panic_without_expect = " warn"
97+ single_char_pattern = " warn"
98+ stable_sort_primitive = " warn"
99+ str_split_at_newline = " warn"
100+ string_add_assign = " warn"
101+ transmute_ptr_to_ptr = " warn"
102+ trivially_copy_pass_by_ref = " warn"
103+ unchecked_duration_subtraction = " warn"
104+ unicode_not_nfc = " warn"
105+ unnecessary_box_returns = " warn"
106+ unnecessary_join = " warn"
107+ unnecessary_literal_bound = " warn"
108+ unnecessary_wraps = " warn"
109+ unsafe_derive_deserialize = " warn"
110+ unused_async = " warn"
111+ unused_self = " warn"
0 commit comments