@@ -57,3 +57,129 @@ name = "tx"
5757[workspace ]
5858members = [" elementsd-tests" ]
5959exclude = [" fuzz" ]
60+
61+ [lints .clippy ]
62+ # Exclude lints we don't think are valuable.
63+ needless_question_mark = " allow" # https://github.com/rust-bitcoin/rust-bitcoin/pull/2134
64+ manual_range_contains = " allow" # More readable than clippy's format.
65+ uninlined_format_args = " allow" # This is a subjective style choice.
66+ float_cmp = " allow" # Bitcoin floats are typically limited to 8 decimal places and we want them exact.
67+ match_bool = " allow" # Adds extra indentation and LOC.
68+ match_same_arms = " allow" # Collapses things that are conceptually unrelated to each other.
69+ must_use_candidate = " allow" # Useful for audit but many false positives.
70+ similar_names = " allow" # Too many (subjectively) false positives.
71+ # Exhaustive list of pedantic clippy lints
72+ assigning_clones = " warn"
73+ bool_to_int_with_if = " warn"
74+ borrow_as_ptr = " warn"
75+ case_sensitive_file_extension_comparisons = " warn"
76+ cast_lossless = " warn"
77+ cast_possible_truncation = " allow" # All casts should include a code comment (except test code).
78+ cast_possible_wrap = " allow" # Same as above re code comment.
79+ cast_precision_loss = " warn"
80+ cast_ptr_alignment = " warn"
81+ cast_sign_loss = " allow" # All casts should include a code comment (except in test code).
82+ checked_conversions = " warn"
83+ cloned_instead_of_copied = " warn"
84+ copy_iterator = " warn"
85+ default_trait_access = " warn"
86+ doc_link_with_quotes = " warn"
87+ doc_markdown = " warn"
88+ empty_enum = " warn"
89+ enum_glob_use = " warn"
90+ expl_impl_clone_on_copy = " warn"
91+ explicit_deref_methods = " warn"
92+ explicit_into_iter_loop = " warn"
93+ explicit_iter_loop = " warn"
94+ filter_map_next = " warn"
95+ flat_map_option = " warn"
96+ fn_params_excessive_bools = " warn"
97+ from_iter_instead_of_collect = " warn"
98+ if_not_else = " warn"
99+ ignored_unit_patterns = " warn"
100+ implicit_clone = " warn"
101+ implicit_hasher = " warn"
102+ inconsistent_struct_constructor = " warn"
103+ index_refutable_slice = " warn"
104+ inefficient_to_string = " warn"
105+ inline_always = " warn"
106+ into_iter_without_iter = " warn"
107+ invalid_upcast_comparisons = " warn"
108+ items_after_statements = " warn"
109+ iter_filter_is_ok = " warn"
110+ iter_filter_is_some = " warn"
111+ iter_not_returning_iterator = " warn"
112+ iter_without_into_iter = " warn"
113+ large_digit_groups = " warn"
114+ large_futures = " warn"
115+ large_stack_arrays = " warn"
116+ large_types_passed_by_value = " warn"
117+ linkedlist = " warn"
118+ macro_use_imports = " warn"
119+ manual_assert = " warn"
120+ manual_instant_elapsed = " warn"
121+ manual_is_power_of_two = " warn"
122+ manual_is_variant_and = " warn"
123+ manual_let_else = " warn"
124+ manual_ok_or = " warn"
125+ manual_string_new = " warn"
126+ many_single_char_names = " warn"
127+ map_unwrap_or = " warn"
128+ match_wildcard_for_single_variants = " warn"
129+ maybe_infinite_iter = " warn"
130+ mismatching_type_param_order = " warn"
131+ missing_errors_doc = " allow" # FIXME this triggers 184 times; we should fix most
132+ missing_fields_in_debug = " warn"
133+ missing_panics_doc = " allow" # FIXME this one has 40 triggers
134+ mut_mut = " warn"
135+ naive_bytecount = " warn"
136+ needless_bitwise_bool = " warn"
137+ needless_continue = " warn"
138+ needless_for_each = " warn"
139+ needless_pass_by_value = " warn"
140+ needless_raw_string_hashes = " warn"
141+ no_effect_underscore_binding = " warn"
142+ no_mangle_with_rust_abi = " warn"
143+ option_as_ref_cloned = " warn"
144+ option_option = " warn"
145+ ptr_as_ptr = " warn"
146+ ptr_cast_constness = " warn"
147+ pub_underscore_fields = " warn"
148+ range_minus_one = " warn"
149+ range_plus_one = " warn"
150+ redundant_closure_for_method_calls = " warn"
151+ redundant_else = " warn"
152+ ref_as_ptr = " warn"
153+ ref_binding_to_reference = " warn"
154+ ref_option = " warn"
155+ ref_option_ref = " warn"
156+ return_self_not_must_use = " warn"
157+ same_functions_in_if_condition = " warn"
158+ semicolon_if_nothing_returned = " warn"
159+ should_panic_without_expect = " warn"
160+ single_char_pattern = " warn"
161+ single_match_else = " warn"
162+ stable_sort_primitive = " warn"
163+ str_split_at_newline = " warn"
164+ string_add_assign = " warn"
165+ struct_excessive_bools = " warn"
166+ struct_field_names = " warn"
167+ too_many_lines = " allow" # FIXME 14 triggers for this lint; probably most should be fixed
168+ transmute_ptr_to_ptr = " warn"
169+ trivially_copy_pass_by_ref = " warn"
170+ unchecked_duration_subtraction = " warn"
171+ unicode_not_nfc = " warn"
172+ unnecessary_box_returns = " warn"
173+ unnecessary_join = " warn"
174+ unnecessary_literal_bound = " warn"
175+ unnecessary_wraps = " warn"
176+ unnested_or_patterns = " warn"
177+ unreadable_literal = " warn"
178+ unsafe_derive_deserialize = " warn"
179+ unused_async = " warn"
180+ unused_self = " warn"
181+ used_underscore_binding = " warn"
182+ used_underscore_items = " warn"
183+ verbose_bit_mask = " warn"
184+ wildcard_imports = " warn"
185+ zero_sized_map_values = " warn"
0 commit comments