diff --git a/cgt/drawing/svg.rs b/cgt/drawing/svg.rs index 7231707..3515f68 100644 --- a/cgt/drawing/svg.rs +++ b/cgt/drawing/svg.rs @@ -1,8 +1,5 @@ //! Simple SVG immediate drawing utilities -#![cfg_attr( - feature = "cargo-clippy", - allow(clippy::missing_errors_doc, clippy::new_ret_no_self) -)] +#![allow(clippy::missing_errors_doc, clippy::new_ret_no_self)] use std::fmt::{self, Write}; diff --git a/cgt/graph/directed.rs b/cgt/graph/directed.rs index a71d072..d2dbe2d 100644 --- a/cgt/graph/directed.rs +++ b/cgt/graph/directed.rs @@ -12,10 +12,7 @@ pub struct Graph { } impl Display for Graph { - #[cfg_attr( - feature = "cargo-clippy", - allow(clippy::missing_inline_in_public_items) - )] + #[allow(clippy::missing_inline_in_public_items)] fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { for (idx, elem) in self.adjacency_matrix.iter().enumerate() { write!(f, "{}", u8::from(*elem))?; diff --git a/cgt/grid.rs b/cgt/grid.rs index 598281c..af8d6b6 100644 --- a/cgt/grid.rs +++ b/cgt/grid.rs @@ -32,7 +32,7 @@ pub trait FiniteGrid: Grid + Sized { fn zero_size() -> Self; /// Default, one-line display function for grids using `|` as row separator - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_errors_doc))] + #[allow(clippy::missing_errors_doc)] fn display(&self, w: &mut impl Write, sep: char) -> std::fmt::Result where Self::Item: CharTile, diff --git a/cgt/grid/small_bit_grid.rs b/cgt/grid/small_bit_grid.rs index adb6b15..cc0bbef 100644 --- a/cgt/grid/small_bit_grid.rs +++ b/cgt/grid/small_bit_grid.rs @@ -166,7 +166,7 @@ where /// Rotate grid 90° clockwise #[must_use] - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] pub fn rotate(&self) -> Self { let mut result = Self::empty(self.height(), self.width()).unwrap(); for y in 0..self.height() { diff --git a/cgt/lib.rs b/cgt/lib.rs index 5f3a521..4260364 100644 --- a/cgt/lib.rs +++ b/cgt/lib.rs @@ -6,14 +6,8 @@ //! [calculations on canonical forms](crate::short::partizan::canonical_form::CanonicalForm) #![warn(missing_docs)] -#![cfg_attr( - feature = "cargo-clippy", - warn( - clippy::all, - clippy::nursery, - clippy::pedantic, - ), - allow( +#![warn(clippy::all, clippy::nursery, clippy::pedantic)] +#![allow( clippy::new_without_default, clippy::similar_names, clippy::must_use_candidate, @@ -27,8 +21,7 @@ clippy::needless_update, clippy::cast_precision_loss, clippy::missing_panics_doc - ) -)] + )] pub mod drawing; pub mod genetic_algorithm; diff --git a/cgt/macros.rs b/cgt/macros.rs index 449ea21..cdabdad 100644 --- a/cgt/macros.rs +++ b/cgt/macros.rs @@ -57,7 +57,7 @@ macro_rules! if_chain { pub(crate) use if_chain; #[test] -#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_const_for_fn))] +#[allow(clippy::missing_const_for_fn)] fn test_if_chain() { let mut _bar; diff --git a/cgt/short/partizan/canonical_form.rs b/cgt/short/partizan/canonical_form.rs index 7d4998d..ea30fba 100644 --- a/cgt/short/partizan/canonical_form.rs +++ b/cgt/short/partizan/canonical_form.rs @@ -213,7 +213,7 @@ impl Nus { /// Parse nus from string, using notation without pluses between number, up, and star components /// /// Pattern: `\d*([v^]\d*)?(\*\d*)` - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_errors_doc))] + #[allow(clippy::missing_errors_doc)] pub fn parse(input: &str) -> nom::IResult<&str, Self> { let full_input = input; // This flag is set if we explicitly parse a number, rather than set it to zero if @@ -380,7 +380,7 @@ impl Moves { /// Try converting moves to NUS. Returns [None] if moves do not form a NUS // Macro expands to loads of ifs - #[cfg_attr(feature = "cargo-clippy", allow(clippy::cognitive_complexity))] + #[allow(clippy::cognitive_complexity)] pub fn to_nus(&self) -> Option { let mut result = Nus::new_integer(0); @@ -736,7 +736,7 @@ impl Moves { } /// Print moves with NUS unwrapped using `{G^L | G^R}` notation - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_errors_doc))] + #[allow(clippy::missing_errors_doc)] pub fn print_deep(&self, f: &mut impl Write) -> fmt::Result { display::braces(f, |f| { for (idx, l) in self.left.iter().enumerate() { @@ -758,7 +758,7 @@ impl Moves { /// Print moves to string with NUS unwrapped using `{G^L | G^R}` notation // Write to `String` never panics - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] pub fn print_deep_to_str(&self) -> String { let mut buf = String::new(); Self::print_deep(self, &mut buf).unwrap(); @@ -1035,7 +1035,7 @@ impl CanonicalForm { } /// Calculate temperature of the game. Avoids computing a thermograph is game is a NUS - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] pub fn temperature(&self) -> DyadicRationalNumber { match self.inner { CanonicalFormInner::Nus(nus) => { @@ -1208,7 +1208,7 @@ impl CanonicalForm { /// A remote star of game `g` is a nimber `*N` if no position of `g` including `g` has value `N*` #[must_use] - #[cfg_attr(feature = "cargo-clippy", allow(clippy::or_fun_call))] + #[allow(clippy::or_fun_call)] pub fn far_star(&self) -> Nimber { if let CanonicalFormInner::Nus(ref nus) = self.inner { if nus.is_nimber() { @@ -1298,7 +1298,7 @@ impl CanonicalForm { } /// Parse game using `{a,b,...|c,d,...}` notation - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_errors_doc))] + #[allow(clippy::missing_errors_doc)] pub fn parse(input: &str) -> nom::IResult<&str, Self> { alt(( |input| Nus::parse(input).map(|(input, nus)| (input, Self::new_nus(nus))), diff --git a/cgt/short/partizan/games/domineering.rs b/cgt/short/partizan/games/domineering.rs index b6ccb22..553b0a9 100644 --- a/cgt/short/partizan/games/domineering.rs +++ b/cgt/short/partizan/games/domineering.rs @@ -174,13 +174,12 @@ where /// ``` // Panic at `Self::empty(minimized_width, minimized_height).unwrap();` is unreachable #[must_use] - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] pub fn move_top_left(&self) -> Self { Self::new(move_top_left(&self.grid, Tile::is_non_blocking)) } } -#[cfg(not(tarpaulin_include))] impl Svg for Domineering where G: Grid + FiniteGrid, diff --git a/cgt/short/partizan/games/fission.rs b/cgt/short/partizan/games/fission.rs index 858f9b5..57f9aa2 100644 --- a/cgt/short/partizan/games/fission.rs +++ b/cgt/short/partizan/games/fission.rs @@ -114,7 +114,6 @@ where } } -#[cfg(not(tarpaulin_include))] impl Svg for Fission where G: Grid + FiniteGrid, diff --git a/cgt/short/partizan/games/ski_jumps.rs b/cgt/short/partizan/games/ski_jumps.rs index 7d7d7ef..c96d47b 100644 --- a/cgt/short/partizan/games/ski_jumps.rs +++ b/cgt/short/partizan/games/ski_jumps.rs @@ -132,7 +132,6 @@ where } } -#[cfg(not(tarpaulin_include))] impl Svg for SkiJumps where G: Grid + FiniteGrid, diff --git a/cgt/short/partizan/games/toads_and_frogs.rs b/cgt/short/partizan/games/toads_and_frogs.rs index c21b530..7141903 100644 --- a/cgt/short/partizan/games/toads_and_frogs.rs +++ b/cgt/short/partizan/games/toads_and_frogs.rs @@ -69,7 +69,6 @@ impl Display for ToadsAndFrogs { } } -#[cfg(not(tarpaulin_include))] impl Svg for ToadsAndFrogs { fn to_svg(&self, buf: &mut W) -> fmt::Result where diff --git a/cgt/short/partizan/thermograph.rs b/cgt/short/partizan/thermograph.rs index 69d8d25..36f3e24 100644 --- a/cgt/short/partizan/thermograph.rs +++ b/cgt/short/partizan/thermograph.rs @@ -29,7 +29,7 @@ impl Thermograph { } /// Get the temperature of the thermograph where both scaffolds merge into a mast - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] pub fn temperature(&self) -> DyadicRationalNumber { let left = self.get_left_temperature(); let right = self.get_right_temperature(); @@ -79,10 +79,7 @@ impl Thermograph { /// Calculate a thermograph given left and right scaffold. Note that scaffolds should be /// [tilted](Trajectory::tilt) before. - #[cfg_attr( - feature = "cargo-clippy", - allow(clippy::cognitive_complexity, clippy::missing_panics_doc) - )] + #[allow(clippy::cognitive_complexity, clippy::missing_panics_doc)] pub fn thermographic_intersection( left_scaffold: Trajectory, right_scaffold: Trajectory, diff --git a/cgt/short/partizan/trajectory.rs b/cgt/short/partizan/trajectory.rs index 82042cd..3cec3ed 100644 --- a/cgt/short/partizan/trajectory.rs +++ b/cgt/short/partizan/trajectory.rs @@ -177,10 +177,7 @@ impl Trajectory { self.minmax::(other) } - #[cfg_attr( - feature = "cargo-clippy", - allow(clippy::useless_let_if_seq, clippy::cognitive_complexity) - )] + #[allow(clippy::useless_let_if_seq, clippy::cognitive_complexity)] fn minmax(&self, other: &Self) -> Self { let max_multiplier = if MAX { -1 } else { 1 }; // We scan down through the critical points. We keep track of which diff --git a/cgt/short/partizan/transposition_table.rs b/cgt/short/partizan/transposition_table.rs index 99d1960..7e69d5c 100644 --- a/cgt/short/partizan/transposition_table.rs +++ b/cgt/short/partizan/transposition_table.rs @@ -62,7 +62,7 @@ impl TranspositionTable for ParallelTranspositionTable where G: Eq + Hash, { - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] #[inline] fn lookup_position(&self, position: &G) -> Option { self.positions @@ -70,7 +70,7 @@ where .map(|id| self.values[*id].clone()) } - #[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_panics_doc))] + #[allow(clippy::missing_panics_doc)] #[inline] fn insert_position(&self, position: G, value: CanonicalForm) { if let Some(known) = self.known_values.get(&value) {