We use clippy and rustc.
// -------------------------------------------------------------------------
// LEVEL 1: CRITICAL ERRORS (Deny)
// -------------------------------------------------------------------------
#![deny(
unreachable_code,
improper_ctypes_definitions,
future_incompatible,
nonstandard_style,
rust_2018_idioms,
clippy::perf,
clippy::correctness,
clippy::suspicious,
clippy::unwrap_used,
clippy::expect_used,
clippy::indexing_slicing,
clippy::arithmetic_side_effects,
clippy::missing_safety_doc,
clippy::same_item_push,
clippy::implicit_clone,
clippy::all,
clippy::pedantic,
missing_docs,
clippy::nursery,
clippy::single_call_fn
)]
// -------------------------------------------------------------------------
// LEVEL 2: STYLE WARNINGS (Warn)
// -------------------------------------------------------------------------
#![warn(
dead_code,
warnings,
unsafe_code,
clippy::dbg_macro,
clippy::todo,
clippy::unnecessary_safety_comment
)]
// -------------------------------------------------------------------------
// LEVEL 3: ALLOW/IGNORABLE (Allow)
// -------------------------------------------------------------------------
#![allow(
clippy::restriction,
clippy::inline_always,
unused_doc_comments,
clippy::cast_possible_truncation,
clippy::cast_sign_loss,
clippy::cast_possible_wrap,
clippy::empty_line_after_doc_comments
)]
// -------------------------------------------------------------------------
// Scientific-computing compromises (documented downgrades)
// -------------------------------------------------------------------------
#![allow(
// `mul_add` is a slow libm call on targets without hardware FMA, and a
// fused rounding changes results between targets; the kernels keep the
// written evaluation order so results are reproducible everywhere.
clippy::suboptimal_flops,
// Counts and indices become `f64` throughout numerics (sample sizes,
// node positions, orders); they stay far below 2^53.
clippy::cast_precision_loss,
// Formulas follow the notation of the literature (`a, b, c, x, y, z`,
// `x0, x1`, `p, q, r, s`), which reads better than spelled-out names.
clippy::many_single_char_names,
clippy::similar_names,
// Fires on `[a, b]` built from separately computed bindings.
clippy::tuple_array_conversions,
// Numerical kernels index several arrays in step (stencils, tableaux,
// matrices); index loops read closest to the formulas they implement.
clippy::needless_range_loop,
// Quadrature nodes, Butcher tableaux and series coefficients are copied
// digit for digit from their references so they can be checked.
clippy::unreadable_literal,
clippy::excessive_precision,
// Time-stepping loops advance a floating-point clock to a final time.
clippy::while_float
)]