Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ repository = "https://github.com/OpenDevicePartnership/embedded-services"
[workspace.lints.rust]
warnings = "deny"

[workspace.lints.clippy]
correctness = "deny"
expect_used = "deny"
indexing_slicing = "deny"
panic = "deny"
panic_in_result_fn = "deny"
perf = "deny"
suspicious = "deny"
style = "deny"
todo = "deny"
unimplemented = "deny"
unreachable = "deny"
unwrap_used = "deny"

[workspace.dependencies]
aligned = "0.4"
anyhow = "1.0"
Expand Down
4 changes: 4 additions & 0 deletions debug-service/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#![no_std]
#![allow(clippy::expect_used)]
#![allow(clippy::indexing_slicing)]
#![allow(clippy::unwrap_used)]

mod debug_service;
mod defmt_ring_logger;
pub mod task;
Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/broadcaster/immediate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl<T: Clone + 'static> Immediate<T> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod test {
use super::*;
use embassy_sync::pubsub::{PubSubChannel, WaitResult};
Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ macro_rules! define_static_buffer {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod test {
extern crate std;
use super::*;
Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/ec_type/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ pub fn mem_map_to_time_alarm_msg(
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use super::*;

Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/ec_type/protocols/mctp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ mod tests {
}

#[test]
#[allow(clippy::panic)]
fn odp_header_error_on_short_buffer() {
let header = OdpHeader {
request_bit: false,
Expand Down
2 changes: 2 additions & 0 deletions embedded-service/src/hid/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,8 @@ impl<'a> Command<'a> {
}

#[cfg(test)]
#[allow(clippy::indexing_slicing)]
#[allow(clippy::unwrap_used)]
mod test {
use super::*;
use crate::define_static_buffer;
Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/hid/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ pub async fn send_request(tp: &Endpoint, to: DeviceId, request: Request<'static>
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod test {
use super::*;

Expand Down
4 changes: 4 additions & 0 deletions embedded-service/src/intrusive_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ mod test {
}

#[test]
#[allow(clippy::unwrap_used)]
fn test_monotype_list() {
let list_a = IntrusiveList::new();
let list_b = IntrusiveList::new();
Expand Down Expand Up @@ -462,6 +463,7 @@ mod test {
}

#[test]
#[allow(clippy::unwrap_used)]
fn test_multitype_list() {
// list with multiple types within it (same registration type)
let list_a = IntrusiveList::new();
Expand Down Expand Up @@ -498,6 +500,7 @@ mod test {
}

#[test]
#[allow(clippy::unwrap_used)]
fn test_multi_list() {
// nodes in multiple lists
let list_a = IntrusiveList::new();
Expand Down Expand Up @@ -554,6 +557,7 @@ mod test {
}

#[test]
#[allow(clippy::unwrap_used)]
fn test_multi_registration_list() {
// list with multiple registration types
let list = IntrusiveList::new();
Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/ipc/deferred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ impl<M: RawMutex, C, R> Request<'_, M, C, R> {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use super::*;
use crate::GlobalRawMutex;
Expand Down
1 change: 1 addition & 0 deletions embedded-service/src/type_c/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ impl IntoIterator for PortPending {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use super::*;

Expand Down
4 changes: 4 additions & 0 deletions espi-service/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#![no_std]
#![allow(clippy::expect_used)]
#![allow(clippy::indexing_slicing)]
#![allow(clippy::panic)]
#![allow(clippy::unwrap_used)]

mod espi_service;
pub mod task;
Expand Down
3 changes: 3 additions & 0 deletions keyboard-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ log = [
"embassy-sync/log",
"hid-service/log",
]

[lints]
workspace = true
4 changes: 4 additions & 0 deletions keyboard-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
//! Otherwise, users may manually implement the `HidKeyboard` trait for custom scanning logic
//! or hardware-implemented key scanners.
#![no_std]
#![allow(clippy::expect_used)]
#![allow(clippy::indexing_slicing)]
#![allow(clippy::panic_in_result_fn)]
#![allow(clippy::unwrap_used)]

pub mod gpio_kb;
pub mod hid_kb;
Expand Down
2 changes: 2 additions & 0 deletions partition-manager/generation/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::unwrap_used)]

mod access;
mod duplicate;
mod overflow;
Expand Down
3 changes: 3 additions & 0 deletions partition-manager/partition-manager/src/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![allow(clippy::panic)]
#![allow(clippy::unwrap_used)]

mod mock;

#[cfg(feature = "bdd")]
Expand Down
3 changes: 3 additions & 0 deletions thermal-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ log = [
"embassy-time/log",
"embassy-sync/log",
]

[lints]
workspace = true
2 changes: 2 additions & 0 deletions thermal-service/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Thermal service
#![no_std]
#![allow(clippy::todo)]
#![allow(clippy::unwrap_used)]

use embassy_sync::once_lock::OnceLock;
use embedded_sensors_hal_async::temperature::DegreesCelsius;
Expand Down
1 change: 1 addition & 0 deletions type-c-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ impl PortEventStreamer {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use core::sync::atomic::AtomicBool;

Expand Down
1 change: 1 addition & 0 deletions type-c-service/src/service/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pub struct Config {
}

#[cfg(test)]
#[allow(clippy::unwrap_used)]
mod tests {
use super::*;

Expand Down