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 Feb 27, 2023
1 parent 89226f6 commit daf5f9d
Show file tree
Hide file tree
Showing 108 changed files with 158 additions and 4 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/parsedbuf/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 paste;

Expand Down
3 changes: 3 additions & 0 deletions crates/spfs-cli/cmd-clean/src/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-cli/cmd-enter/src/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-cli/cmd-join/src/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 std::ffi::OsString;

use clap::Parser;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs-cli/cmd-monitor/src/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-cli/common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

//! Common macros and argument structures for the spfs command line
mod args;
Expand Down
3 changes: 3 additions & 0 deletions crates/spfs-cli/main/src/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
1 change: 1 addition & 0 deletions crates/spfs-cli/main/src/cmd_write.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::path::PathBuf;

use clap::Args;
Expand Down
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
1 change: 1 addition & 0 deletions crates/spfs/src/bootstrap.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::ffi::{OsStr, OsString};
use std::path::{Path, PathBuf};

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::path::PathBuf;
use std::sync::{Arc, RwLock};

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::io;
use std::str::Utf8Error;

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

//! Filesystem isolation, capture and distribution.
#![deny(unsafe_op_in_unsafe_fn)]
#![warn(clippy::fn_params_excessive_bools)]

//! Filesystem isolation, capture and distribution.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/proto/conversions.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::convert::{TryFrom, TryInto};
use std::ops::Not;

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/proto/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

//! Protocol Buffer message formats and conversions.
mod conversions;
Expand Down
5 changes: 3 additions & 2 deletions crates/spfs/src/resolve_test.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::sync::Arc;

// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::sync::Arc;

use rstest::rstest;

use super::resolve_stack_to_layers;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/server/database.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::convert::TryInto;
use std::pin::Pin;
use std::sync::Arc;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/server/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

//! Remote rpc server implementation of the spfs repository
mod database;
mod payload;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/server/tag.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::convert::TryInto;
use std::sync::Arc;

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use async_trait::async_trait;

use crate::Result;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/database_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use rstest::rstest;

use crate::fixtures::*;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/payload_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use futures::TryStreamExt;
use rstest::rstest;
use tokio::io::AsyncReadExt;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/repository.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::collections::HashSet;
use std::pin::Pin;

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/rpc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

//! Storage implementation which is a client of the built-in spfs server
mod database;
Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/rpc/payload.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::convert::TryInto;
use std::pin::Pin;

Expand Down
1 change: 1 addition & 0 deletions crates/spfs/src/storage/tag_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::os::unix::fs::MetadataExt;

use chrono::prelude::*;
Expand Down
1 change: 1 addition & 0 deletions crates/spk-build/src/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

mod binary;
mod sources;

Expand Down
1 change: 1 addition & 0 deletions crates/spk-build/src/build/sources_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use rstest::rstest;
use spk_schema::foundation::fixtures::*;
use spk_schema::ident::build_ident;
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/cmd_env.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::ffi::OsString;

use anyhow::{Context, Result};
Expand Down
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;
4 changes: 4 additions & 0 deletions crates/spk-cli/cmd-render/src/cmd_render.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// 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::path::PathBuf;

use anyhow::{bail, Context, Result};
Expand Down
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/cmd_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::str::FromStr;
use std::sync::Arc;

Expand Down
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/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 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.
use anyhow::Result;
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/cmd_deprecate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use std::io::Write;
use std::sync::Arc;

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/cmd_new.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Sony Pictures Imageworks, et al.
// SPDX-License-Identifier: Apache-2.0
// https://github.com/imageworks/spk

use anyhow::Result;
use clap::Args;
use colored::Colorize;
Expand Down
Loading

0 comments on commit daf5f9d

Please sign in to comment.