diff --git a/libwayshot/src/convert.rs b/libwayshot/src/convert.rs index 6df3e655..dd6896ac 100644 --- a/libwayshot/src/convert.rs +++ b/libwayshot/src/convert.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use image::ColorType; use wayland_client::protocol::wl_shm; diff --git a/libwayshot/src/dispatch.rs b/libwayshot/src/dispatch.rs index 9b760c21..c5f89a55 100644 --- a/libwayshot/src/dispatch.rs +++ b/libwayshot/src/dispatch.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use std::{ process::exit, sync::atomic::{AtomicBool, Ordering}, diff --git a/libwayshot/src/error.rs b/libwayshot/src/error.rs index ddeff581..55cd8fdd 100644 --- a/libwayshot/src/error.rs +++ b/libwayshot/src/error.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use std::{io, result}; use thiserror::Error; diff --git a/libwayshot/src/image_util.rs b/libwayshot/src/image_util.rs index 1099395b..0f46c693 100644 --- a/libwayshot/src/image_util.rs +++ b/libwayshot/src/image_util.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use image::RgbaImage; use wayland_client::protocol::wl_output::Transform; diff --git a/libwayshot/src/lib.rs b/libwayshot/src/lib.rs index 67c29a38..88367fc0 100644 --- a/libwayshot/src/lib.rs +++ b/libwayshot/src/lib.rs @@ -3,6 +3,24 @@ //! //! To get started, look at [`WayshotConnection`]. +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + mod convert; mod dispatch; mod error; diff --git a/libwayshot/src/output.rs b/libwayshot/src/output.rs index ccca1c80..38e41665 100644 --- a/libwayshot/src/output.rs +++ b/libwayshot/src/output.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use wayland_client::protocol::{wl_output, wl_output::WlOutput}; /// Represents an accessible wayland output. diff --git a/libwayshot/src/screencopy.rs b/libwayshot/src/screencopy.rs index 86cf86cd..6c7d3426 100644 --- a/libwayshot/src/screencopy.rs +++ b/libwayshot/src/screencopy.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use std::{ ffi::CStr, os::fd::{AsRawFd, IntoRawFd, OwnedFd}, diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..292fe499 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" diff --git a/wayshot/src/clap.rs b/wayshot/src/clap.rs index 37319334..ff59f385 100644 --- a/wayshot/src/clap.rs +++ b/wayshot/src/clap.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use clap::{arg, ArgAction, Command}; pub fn set_flags() -> Command { diff --git a/wayshot/src/utils.rs b/wayshot/src/utils.rs index e24caf74..f321b2d1 100644 --- a/wayshot/src/utils.rs +++ b/wayshot/src/utils.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use std::{ process::exit, time::{SystemTime, UNIX_EPOCH}, diff --git a/wayshot/src/wayshot.rs b/wayshot/src/wayshot.rs index b4b3c01f..7a0cd2e0 100644 --- a/wayshot/src/wayshot.rs +++ b/wayshot/src/wayshot.rs @@ -1,3 +1,21 @@ +#![deny(warnings)] +#![warn(unused_extern_crates)] +// Enable some groups of clippy lints. +#![deny(clippy::suspicious)] +#![deny(clippy::perf)] +// Specific lints to enforce. +#![warn(clippy::todo)] +#![deny(clippy::unimplemented)] +#![deny(clippy::unwrap_used)] +#![deny(clippy::expect_used)] +#![deny(clippy::panic)] +#![deny(clippy::await_holding_lock)] +#![deny(clippy::needless_pass_by_value)] +#![deny(clippy::trivially_copy_pass_by_ref)] +#![deny(clippy::disallowed_types)] +#![deny(clippy::manual_let_else)] +#![allow(clippy::unreachable)] + use std::{ error::Error, io::{stdout, BufWriter, Cursor, Write},