Skip to content

Commit

Permalink
refactor: Standardize linting rules
Browse files Browse the repository at this point in the history
- Removed split linting warnings across multiple files, removing clippy::too_many_arguments allowances
- Modified the clippy lint settings, denying previously allowed lints, and used config to enforce prior behavior
  • Loading branch information
huitseeker committed Aug 15, 2023
1 parent b63f1db commit 531d0f2
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
type-complexity-threshold = 999
too-many-arguments-threshold = 20
disallowed-methods = [
# we use strict naming for pasta fields
Expand Down
2 changes: 0 additions & 2 deletions fcomm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,6 @@ impl<F: LurkField + Serialize + DeserializeOwned> Expression<F> {
}

impl<'a> Opening<S1> {
#[allow(clippy::too_many_arguments)]
pub fn apply_and_prove(
s: &'a mut Store<S1>,
input: Ptr<S1>,
Expand Down Expand Up @@ -786,7 +785,6 @@ impl<'a> Opening<S1> {
}

impl<'a> Proof<'a, S1> {
#[allow(clippy::too_many_arguments)]
pub fn eval_and_prove(
s: &'a mut Store<S1>,
expr: Ptr<S1>,
Expand Down
1 change: 0 additions & 1 deletion src/circuit/gadgets/constraints.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Initially taken from: rust-fil-proofs/storage-proofs-core/src/gadgets/

use crate::field::LurkField;
use bellperson::LinearCombination;
use bellperson::{
Expand Down
1 change: 0 additions & 1 deletion src/circuit/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(clippy::too_many_arguments)]
use crate::field::LurkField;

use crate::eval::IO;
Expand Down
1 change: 0 additions & 1 deletion src/eval/reduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ impl<F: LurkField> Control<F> {
}
}

#[allow(clippy::too_many_arguments)]
fn reduce_with_witness_inner<F: LurkField, C: Coprocessor<F>>(
expr: Ptr<F>,
env: Ptr<F>,
Expand Down
2 changes: 1 addition & 1 deletion src/hash_witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub type ConsWitness<F> = HashWitness<ConsName, Cons<F>, MAX_CONSES_PER_REDUCTIO
pub type ContWitness<F> = HashWitness<ContName, Cont<F>, MAX_CONTS_PER_REDUCTION, F>;

impl<F: LurkField> HashWitness<ConsName, Cons<F>, MAX_CONSES_PER_REDUCTION, F> {
#[allow(dead_code)]
#[allow(dead_code, clippy::single_match)]
fn assert_specific_invariants(&self, store: &Store<F>) {
// Use the commented code below to search for (non-nil) duplicated conses, which could indicate that two
// different Cons are being used to reference the identical structural value. In that case, they could be
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::single_match, clippy::type_complexity)]
#![deny(unreachable_pub)]
#![allow(clippy::uninlined_format_args)]
#![warn(rust_2018_idioms, unreachable_pub)]

Expand Down
1 change: 0 additions & 1 deletion src/proof/groth16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ impl<C: Coprocessor<Scalar>> Groth16Prover<Bls12, C, Scalar> {

/// Generates an outer Groth16 proof using the given parameters, SRS, expression, environment,
/// store, limit, and random number generator.
#[allow(clippy::too_many_arguments)]
pub fn outer_prove<R: RngCore + Clone>(
&self,
params: &groth16::Parameters<Bls12>,
Expand Down

0 comments on commit 531d0f2

Please sign in to comment.