Skip to content

Commit

Permalink
Add crate-wide config to all crates; customize clippy settings
Browse files Browse the repository at this point in the history
Enable checking of excessive bool parameters in all crates, and limit to 1.
Limit the number of arguments to 5.

Signed-off-by: J Robert Ray <jrray@jrray.org>
  • Loading branch information
jrray committed Aug 26, 2022
1 parent 60ccec5 commit 8bfecd4
Show file tree
Hide file tree
Showing 39 changed files with 80 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# default is 3
max-fn-params-bools = 1

# default is 7
too-many-arguments-threshold = 5
1 change: 1 addition & 0 deletions crates/spfs-encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#![deny(missing_docs)]
#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod binary;
mod error;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs/src/cli/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use clap::{Parser, Subcommand};
use spfs::Error;

Expand Down
3 changes: 3 additions & 0 deletions crates/spfs/src/cli/cmd_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use chrono::prelude::*;
use clap::Parser;
use colored::*;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs/src/cli/cmd_enter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use std::ffi::OsString;

use clap::Parser;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs/src/cli/cmd_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use clap::Parser;
use spfs::{Error, Result};
use std::ffi::OsString;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs/src/cli/cmd_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use std::time::Duration;

use clap::Parser;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs/src/cli/cmd_render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use clap::Parser;

use spfs::{prelude::*, Error};
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
//! Filesystem isolation, capture and distribution.
#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub const VERSION: &str = env!("CARGO_PKG_VERSION");

Expand Down
3 changes: 3 additions & 0 deletions crates/spk-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod build;
mod error;

Expand Down
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_build;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-convert/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_convert;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_env;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-explain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_explain;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-install/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_install;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-make-binary/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_make_binary;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-make-source/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_make_source;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_render;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-repo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_repo;
1 change: 1 addition & 0 deletions crates/spk-cli/cmd-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_test;

Expand Down
1 change: 1 addition & 0 deletions crates/spk-cli/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod cli;
mod env;
Expand Down
1 change: 1 addition & 0 deletions crates/spk-cli/group1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_bake;
pub mod cmd_deprecate;
Expand Down
1 change: 1 addition & 0 deletions crates/spk-cli/group2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_ls;
pub mod cmd_new;
Expand Down
1 change: 1 addition & 0 deletions crates/spk-cli/group3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_export;
pub mod cmd_import;
1 change: 1 addition & 0 deletions crates/spk-cli/group4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod cmd_search;
pub mod cmd_version;
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-exec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod exec;

Expand Down
1 change: 1 addition & 0 deletions crates/spk-schema/crates/foundation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub mod env;
pub mod fixtures;
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-schema/crates/ident/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod format;
mod ident;
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-schema/crates/validators/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod validators;

Expand Down
3 changes: 3 additions & 0 deletions crates/spk-schema/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod build_spec;
mod component_spec;
mod component_spec_list;
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-solve/crates/graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod graph;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn make_tag_part(pieces: Vec<&str>) -> Option<Vec<BuildKeyVersionNumberPiece>> {

// For making test case results
#[allow(clippy::too_many_arguments)]
#[allow(clippy::fn_params_excessive_bools)]
fn make_expanded_version_range_part(
version: &str,
max_digits: Vec<u32>,
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-solve/crates/package-iterator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod build_key;
mod error;
mod package_iterator;
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-solve/crates/solution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod solution;

Expand Down
3 changes: 3 additions & 0 deletions crates/spk-solve/crates/validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod validation;

Expand Down
3 changes: 3 additions & 0 deletions crates/spk-solve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
mod io;
mod macros;
Expand Down
3 changes: 3 additions & 0 deletions crates/spk-storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

mod error;
pub mod fixtures;
mod storage;
Expand Down
4 changes: 4 additions & 0 deletions crates/spk/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

//! Main entry points and utilities for command line interface and interaction.
#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

use anyhow::{Context, Result};
use clap::{Parser, Subcommand};
use colored::Colorize;
Expand Down
1 change: 1 addition & 0 deletions crates/spk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/imageworks/spk

#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

pub use spk_build as build;
pub use spk_exec as exec;
Expand Down

0 comments on commit 8bfecd4

Please sign in to comment.