Skip to content

Commit

Permalink
Add warn in crates; remove warn in test_clippy.py
Browse files Browse the repository at this point in the history
Signed-off-by: StemCll [email protected]
  • Loading branch information
StemCll committed Oct 31, 2022
1 parent 86300b8 commit 8aa0094
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/api_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! Implements the interface for intercepting API requests, forwarding them to the VMM
//! and responding to the user.
//! It is constructed on top of an HTTP Server that uses Unix Domain Sockets and `EPOLL` to
Expand Down
1 change: 1 addition & 0 deletions src/arch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! Implements platform specific functionality.
//! Supported platforms: x86_64 and aarch64.
use std::{fmt, result};
Expand Down
1 change: 1 addition & 0 deletions src/cpuid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! Utility for configuring the CPUID (CPU identification) for the guest microVM.
#![cfg(target_arch = "x86_64")]
Expand Down
1 change: 1 addition & 0 deletions src/devices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// found in the THIRD-PARTY file.

#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! Emulates virtual and hardware devices.
use std::io;

Expand Down
1 change: 1 addition & 0 deletions src/dumbo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! Provides helper logic for parsing and writing protocol data units, and minimalist
//! implementations of a TCP listener, a TCP connection, and an HTTP/1.1 server.
pub mod pdu;
Expand Down
1 change: 1 addition & 0 deletions src/firecracker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

mod api_server_adapter;
mod metrics;
Expand Down
1 change: 1 addition & 0 deletions src/io_uring/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! High-level interface over Linux io_uring.
//!
//! Aims to provide an easy-to-use interface, while making some Firecracker-specific simplifying
Expand Down
1 change: 1 addition & 0 deletions src/jailer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

mod cgroup;
mod chroot;
Expand Down
1 change: 1 addition & 0 deletions src/logger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! Crate that implements Firecracker specific functionality as far as logging and metrics
//! collecting.
Expand Down
1 change: 1 addition & 0 deletions src/mmds/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

pub mod data_store;
pub mod ns;
Expand Down
1 change: 1 addition & 0 deletions src/rate_limiter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]
//! # Rate Limiter
//!
//! Provides a rate limiter written in Rust useful for IO operations that need to
Expand Down
1 change: 1 addition & 0 deletions src/rebase-snap/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

use std::fs::{File, OpenOptions};
use std::io::{Seek, SeekFrom};
Expand Down
1 change: 1 addition & 0 deletions src/seccompiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

//! The library crate that defines common helper functions that are generally used in
//! conjunction with seccompiler-bin.
Expand Down
1 change: 1 addition & 0 deletions src/snapshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
#![deny(missing_docs)]
#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

//! Provides version tolerant serialization and deserialization facilities and
//! implements a persistent storage format for Firecracker state snapshots.
Expand Down
1 change: 1 addition & 0 deletions src/utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

#![warn(clippy::ptr_as_ptr)]
#![warn(clippy::cast_lossless)]

// We use `utils` as a wrapper over `vmm_sys_util` to control the latter
// dependency easier (i.e. update only in one place `vmm_sys_util` version).
Expand Down
3 changes: 1 addition & 2 deletions tests/integration_tests/build/test_clippy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ def test_rust_clippy(target):
@type: build
"""
utils.run_cmd(
"cargo clippy --target {} --all --profile test"
" -- -D warnings -D clippy::cast_lossless".format(target)
"cargo clippy --target {} --all --profile test" " -- -D warnings".format(target)
)

0 comments on commit 8aa0094

Please sign in to comment.