diff --git a/Cargo.toml b/Cargo.toml index a1f41d09..2fecfbc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,14 @@ [workspace] resolver = "2" members = ["buildpacks/ruby", "commons"] + +[workspace.package] +edition = "2021" +rust-version = "1.74" + +[workspace.lints.rust] +unused_crate_dependencies = "warn" + +[workspace.lints.clippy] +pedantic = "warn" +module_name_repetitions = "allow" diff --git a/buildpacks/ruby/Cargo.toml b/buildpacks/ruby/Cargo.toml index 83f56e0f..be6d494e 100644 --- a/buildpacks/ruby/Cargo.toml +++ b/buildpacks/ruby/Cargo.toml @@ -3,8 +3,11 @@ name = "heroku-ruby-buildpack" # This crate is not published, so the only version that is used is the one in buildpack.toml. version = "0.0.0" publish = false -edition = "2021" -rust-version = "1.66" +edition.workspace = true +rust-version.workspace = true + +[lints] +workspace = true [dependencies] commons = { path = "../../commons" } diff --git a/buildpacks/ruby/src/bin/agentmon_loop.rs b/buildpacks/ruby/src/bin/agentmon_loop.rs index c951f809..f26c8363 100644 --- a/buildpacks/ruby/src/bin/agentmon_loop.rs +++ b/buildpacks/ruby/src/bin/agentmon_loop.rs @@ -1,6 +1,5 @@ -// Enable Clippy lints that are disabled by default. -// https://rust-lang.github.io/rust-clippy/stable/index.html -#![warn(clippy::pedantic)] +// Required due to: https://github.com/rust-lang/rust/issues/95513 +#![allow(unused_crate_dependencies)] use clap::Parser; use std::ffi::OsStr; diff --git a/buildpacks/ruby/src/bin/launch_daemon.rs b/buildpacks/ruby/src/bin/launch_daemon.rs index bb243b86..19cf5f38 100644 --- a/buildpacks/ruby/src/bin/launch_daemon.rs +++ b/buildpacks/ruby/src/bin/launch_daemon.rs @@ -1,3 +1,6 @@ +// Required due to: https://github.com/rust-lang/rust/issues/95513 +#![allow(unused_crate_dependencies)] + use clap::Parser; use std::path::PathBuf; use std::process::exit; @@ -75,7 +78,7 @@ fn main() { eprintln!( "Could not write to log file {}. Reason: {error}", log.display() - ) + ); }); command.args(["--output", &log.to_string_lossy()]); @@ -88,7 +91,7 @@ fn main() { eprintln!( "Could not write to log file {}. Reason: {error}", log.display() - ) + ); }); } diff --git a/buildpacks/ruby/src/main.rs b/buildpacks/ruby/src/main.rs index 8b372c26..2424d89a 100644 --- a/buildpacks/ruby/src/main.rs +++ b/buildpacks/ruby/src/main.rs @@ -1,6 +1,3 @@ -#![warn(unused_crate_dependencies)] -#![warn(clippy::pedantic)] -#![allow(clippy::module_name_repetitions)] use commons::cache::CacheError; use commons::gemfile_lock::GemfileLock; use commons::metadata_digest::MetadataDigest; diff --git a/buildpacks/ruby/tests/integration_test.rs b/buildpacks/ruby/tests/integration_test.rs index 3e64d2e7..7d60cc5c 100644 --- a/buildpacks/ruby/tests/integration_test.rs +++ b/buildpacks/ruby/tests/integration_test.rs @@ -1,4 +1,5 @@ -#![warn(clippy::pedantic)] +// Required due to: https://github.com/rust-lang/rust/issues/95513 +#![allow(unused_crate_dependencies)] use libcnb_test::{ assert_contains, assert_empty, BuildConfig, BuildpackReference, ContainerConfig, diff --git a/commons/Cargo.toml b/commons/Cargo.toml index b10a387c..d0e5b57a 100644 --- a/commons/Cargo.toml +++ b/commons/Cargo.toml @@ -1,13 +1,17 @@ [package] name = "commons" version = "1.0.0" -edition = "2021" publish = false +edition.workspace = true +rust-version.workspace = true [[bin]] name = "print_style_guide" path = "bin/print_style_guide.rs" +[lints] +workspace = true + [dependencies] byte-unit = "4" fancy-regex = "0.12" diff --git a/commons/bin/print_style_guide.rs b/commons/bin/print_style_guide.rs index 0552fbee..bce8c0fb 100644 --- a/commons/bin/print_style_guide.rs +++ b/commons/bin/print_style_guide.rs @@ -1,5 +1,9 @@ +// Required due to: https://github.com/rust-lang/rust/issues/95513 +#![allow(unused_crate_dependencies)] + use ascii_table::AsciiTable; use commons::output::fmt::{self, DEBUG_INFO, HELP}; +#[allow(clippy::wildcard_imports)] use commons::output::{ build_log::*, section_log::{log_step, log_step_stream, log_step_timed}, @@ -9,6 +13,7 @@ use indoc::formatdoc; use std::io::stdout; use std::process::Command; +#[allow(clippy::too_many_lines)] fn main() { println!( "{}", diff --git a/commons/src/cache.rs b/commons/src/cache.rs index f6480876..f7b2ce22 100644 --- a/commons/src/cache.rs +++ b/commons/src/cache.rs @@ -1,4 +1,3 @@ -#![allow(clippy::module_name_repetitions)] mod app_cache; mod app_cache_collection; mod clean; diff --git a/commons/src/cache/config.rs b/commons/src/cache/config.rs index e6d8749c..364fd381 100644 --- a/commons/src/cache/config.rs +++ b/commons/src/cache/config.rs @@ -2,7 +2,6 @@ use byte_unit::{n_mib_bytes, Byte}; use std::path::PathBuf; /// Configure behavior of a cached path -#[allow(clippy::module_name_repetitions)] #[derive(Clone, Debug, PartialEq, Eq)] pub struct CacheConfig { /// Path to the directory you want to cache diff --git a/commons/src/cache/error.rs b/commons/src/cache/error.rs index 0c8a228c..4a5f4e73 100644 --- a/commons/src/cache/error.rs +++ b/commons/src/cache/error.rs @@ -1,6 +1,5 @@ use std::path::PathBuf; -#[allow(clippy::module_name_repetitions)] #[derive(thiserror::Error, Debug)] pub enum CacheError { #[error("Cached path not in application directory: {0}")] diff --git a/commons/src/layer.rs b/commons/src/layer.rs index 74807ed9..48d5a73b 100644 --- a/commons/src/layer.rs +++ b/commons/src/layer.rs @@ -1,4 +1,3 @@ -#![allow(clippy::module_name_repetitions)] mod configure_env_layer; mod default_env_layer; diff --git a/commons/src/lib.rs b/commons/src/lib.rs index 4cede6f7..302abf29 100644 --- a/commons/src/lib.rs +++ b/commons/src/lib.rs @@ -1,6 +1,3 @@ -#![warn(unused_crate_dependencies)] -#![warn(clippy::pedantic)] - // Used in both testing and printing the style guide use indoc as _; diff --git a/commons/src/output/build_log.rs b/commons/src/output/build_log.rs index 715beb62..39e0d47f 100644 --- a/commons/src/output/build_log.rs +++ b/commons/src/output/build_log.rs @@ -31,7 +31,6 @@ use std::time::{Duration, Instant}; /// /// For usage details run `cargo run --bin print_style_guide` -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] pub struct BuildLog { pub(crate) io: W, diff --git a/commons/src/output/warn_later.rs b/commons/src/output/warn_later.rs index b95b2be5..37f55619 100644 --- a/commons/src/output/warn_later.rs +++ b/commons/src/output/warn_later.rs @@ -123,7 +123,6 @@ fn take() -> Option> { WARN_LATER.with(|cell| cell.replace(None)) } -#[allow(clippy::module_name_repetitions)] #[derive(Debug)] pub enum WarnLaterError { MissingGuardForThread(ThreadId),