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