@@ -130,6 +130,158 @@ serde_with = { version = "2.2.0", default-features = false }
130130parity-scale-codec = { version = " 3.2.1" , default-features = false }
131131json5 = " 0.4.1"
132132
133+ [workspace .lints ]
134+ rust.anonymous_parameters = " deny"
135+
136+ # lower the priority to allow overriding later
137+ clippy.pedantic = { level = " deny" , priority = -1 }
138+ clippy.all = { level = " deny" , priority = -1 }
139+ clippy.dbg_macro = " deny"
140+
141+ # clippy.nursery = "deny"
142+ clippy.debug_assert_with_mut_call = " deny"
143+ clippy.derive_partial_eq_without_eq = " deny"
144+ clippy.empty_line_after_outer_attr = " deny"
145+ clippy.fallible_impl_from = " deny"
146+ clippy.future_not_send = " deny"
147+ clippy.iter_with_drain = " deny"
148+ clippy.mutex_integer = " deny"
149+ clippy.needless_collect = " deny"
150+ clippy.path_buf_push_overwrite = " deny"
151+ clippy.suboptimal_flops = " deny"
152+ clippy.trailing_empty_array = " deny"
153+ clippy.transmute_undefined_repr = " deny"
154+ clippy.trivial_regex = " deny"
155+ clippy.unused_peekable = " deny"
156+ clippy.unused_rounding = " deny"
157+
158+ rust.future_incompatible = " deny"
159+ rust.missing_copy_implementations = " deny"
160+ rust.missing_docs = " deny"
161+ rust.nonstandard_style = " deny"
162+ rust.private_doc_tests = " deny"
163+ rust.rust_2018_idioms = " deny"
164+ rust.trivial_casts = " deny"
165+ rust.trivial_numeric_casts = " deny"
166+ rust.unconditional_recursion = " deny"
167+ rust.unsafe_code = " deny"
168+ rust.unused = " deny"
169+ rust.unused_import_braces = " deny"
170+ rust.variant_size_differences = " deny"
171+ rust.unused_tuple_struct_fields = " deny"
172+ rust.explicit_outlives_requirements = " deny"
173+ rust.non_ascii_idents = " deny"
174+ # TODO: reenable
175+ # rust.unreachable_pub = "deny"
176+ # rust.unsafe_op_in_unsafe_fn = "deny"
177+
178+ # These are up to personal taste. We don't want these to be enabled ever.
179+ clippy.string_add = " allow"
180+ clippy.as_conversions = " allow"
181+ clippy.else_if_without_else = " allow"
182+ clippy.enum_glob_use = " allow"
183+ clippy.exhaustive_enums = " allow"
184+ clippy.exhaustive_structs = " allow"
185+ clippy.implicit_return = " allow"
186+ clippy.inconsistent_struct_constructor = " allow"
187+ clippy.indexing_slicing = " allow"
188+ clippy.arithmetic_side_effects = " allow"
189+ clippy.let_underscore_must_use = " allow"
190+ clippy.match_wildcard_for_single_variants = " allow"
191+ clippy.missing_docs_in_private_items = " allow"
192+ clippy.module_name_repetitions = " allow"
193+ clippy.shadow_reuse = " allow"
194+ clippy.shadow_same = " allow"
195+
196+ # These are normally decisions, which need to be audited by a human.
197+ clippy.unwrap_in_result = " allow"
198+ clippy.expect_used = " allow"
199+ clippy.unreachable = " allow"
200+ clippy.wildcard_enum_match_arm = " allow"
201+ clippy.wildcard_imports = " allow"
202+ # Our preferred style.
203+ clippy.non-ascii-literal = " allow"
204+ clippy.std_instead_of_core = " allow"
205+
206+ # This lint could be useful in theory. The trade-off of making
207+ # refactoring away from references difficult isn't worth it in all
208+ # cases, so if it is enabled, it should be enabled locally.
209+ clippy.pattern_type_mismatch = " allow"
210+
211+ # Style guide.
212+ clippy.mod-module-files = " allow"
213+ clippy.separated-literal-suffix = " allow"
214+ # Most trybuild code triggers a false-positive.
215+
216+ # Not all public items should be inline. We only inline **trivial** functions.
217+ clippy.missing_inline_in_public_items = " allow"
218+
219+ # --- Re-enable candidates -----
220+
221+ # Lots of false-positives.
222+ clippy.self-named-module-files = " allow"
223+ clippy.manual_let_else = " allow"
224+
225+ # We often need to shadow the name of the method to specialise.
226+ # As soon as trait specialisation is stable we need to remove it.
227+ clippy.same_name_method = " allow"
228+ clippy.pub_use = " allow"
229+
230+ # Style guide candidate. Explicitly converting the return value to
231+ # () is good for refactoring, and if there is necessary
232+ # processing of the data returned by a function, it should
233+ # **really** be marked as #[must_use]
234+ clippy.semicolon_if_nothing_returned = " allow"
235+
236+ # This lint has way too many false-positives, so even enabling it
237+ # as a warning is too much. Instead prefer adding explicit
238+ # `#[deny]` directives
239+ clippy.must_use_candidate = " allow"
240+
241+ # Unstable and many false-positives
242+ # # https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
243+ clippy.missing_const_for_fn = " allow"
244+
245+ # Too much affected code. Often impossible to apply suggestion on stable rust.
246+ rust.elided_lifetimes_in_paths = " allow"
247+
248+ # This lint produces a lot of false positives. Recommend local #[deny] directives
249+ clippy.use_self = " allow"
250+
251+ # We don't want to manually deny every `clippy.restriction.*` lint.
252+ clippy.blanket-clippy-restriction-lints = " allow"
253+
254+ # A lot of false-positive.
255+ clippy.partial_pub_fields = " allow"
256+
257+ # Should be enabled per trait impl rather than globally.
258+ clippy.missing_trait_methods = " allow"
259+
260+ # We allow this and deny `clippy.semicolon_inside_block`.
261+ clippy.semicolon_outside_block = " allow"
262+
263+ # It is debatable whether it's actually easier to read,
264+ # additionally, not all patterns are covered by the inlined syntax
265+ clippy.uninlined_format_args = " allow"
266+
267+ rust.unknown_lints = " warn"
268+ # these lints were duplicated, with `allow` taking precedence
269+ # clippy.inconsistent_struct_constructor = "warn"
270+ # clippy.match_wildcard_for_single_variants = "warn"
271+ # clippy.arithmetic_side_effects = "warn"
272+ clippy.option_if_let_else = " warn"
273+ clippy.or_fun_call = " warn"
274+ clippy.redundant_pub_crate = " warn"
275+ clippy.string_lit_as_bytes = " warn"
276+ clippy.suspicious_operation_groupings = " warn"
277+ clippy.useless_let_if_seq = " warn"
278+
279+ # unstable
280+ # rust.non_exhaustive_omitted_patterns = "warn"
281+
282+ rust.single_use_lifetimes = " warn"
283+ rust.unused_lifetimes = " warn"
284+
133285[workspace ]
134286resolver = " 2"
135287members = [
0 commit comments