mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
3a6b7f11ce
This applies the same clippy config to rust_analyzer as well. BUG=b:193893457 TEST=./tools/clippy and VSCode show the same linter results Change-Id: I5deec4a24d71fec4692ed708664130f46c1311b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3278773 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Dennis Kempin <denniskempin@google.com>
64 lines
1.7 KiB
Bash
Executable file
64 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
# Copyright 2019 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
# To check for violations:
|
|
# $ ./tools/clippy
|
|
#
|
|
# To fix violations where possible:
|
|
# $ ./tools/clippy --fix
|
|
|
|
set -e
|
|
cd "$(dirname $0)/.."
|
|
|
|
# TODO(b/192373803): Clean up clippy error is the following crates
|
|
EXCLUDE=(
|
|
aarch64 # 16 errors
|
|
acpi_tables # 4 errors
|
|
crosvm-fuzz # 7 errors
|
|
devices # 92 errors
|
|
disk # 36 errors
|
|
hypervisor # 2 errors
|
|
integration_tests # 4 errors
|
|
kernel_loader # 8 errors
|
|
kvm # 641 errors
|
|
kvm_sys # 613 errors
|
|
libcrosvm_control # 5 errors
|
|
libvda # 79 errors
|
|
net_sys # 3 errors
|
|
qcow_utils # 4 errors
|
|
rutabaga_gfx # 10 errors
|
|
rutabaga_gfx_ffi # 3 errors
|
|
usb_util # 5 errors
|
|
vhost # 2 errors
|
|
virtio_sys # 9 errors
|
|
vm_memory # 9 errors
|
|
x86_64 # 56 errors
|
|
)
|
|
|
|
EXCLUDE_COMMON=(
|
|
common/cros-fuzz # 2 errors
|
|
common/cros_async # 8 errors
|
|
common/io_uring # 8 errors
|
|
common/p9 # 3 errors
|
|
common/sys_util # 2 errors
|
|
)
|
|
|
|
# Note: Clippy checks are configured in .cargo/config.toml
|
|
echo "Clippy crosvm workspace"
|
|
cargo clippy \
|
|
--workspace \
|
|
--features all-linux \
|
|
--all-targets \
|
|
${EXCLUDE[@]/#/--exclude } \
|
|
"$@" -- -Dwarnings
|
|
|
|
for crate in common/*; do
|
|
if [ -d "${crate}" ] &&
|
|
[[ ! " ${EXCLUDE_COMMON[*]} " =~ " ${crate} " ]]; then
|
|
echo ""
|
|
echo "Clippy ${crate}"
|
|
(cd "${crate}" && cargo clippy --all-targets "$@" -- -Dwarnings)
|
|
fi
|
|
done
|