2021-10-15 01:56:44 +00:00
|
|
|
#!/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.
|
|
|
|
|
2021-11-12 17:35:42 +00:00
|
|
|
# To check for violations:
|
|
|
|
# $ ./tools/clippy
|
|
|
|
#
|
|
|
|
# To fix violations where possible:
|
|
|
|
# $ ./tools/clippy --fix
|
|
|
|
|
2021-11-11 23:14:38 +00:00
|
|
|
set -e
|
|
|
|
cd "$(dirname $0)/.."
|
2021-10-15 01:56:44 +00:00
|
|
|
|
2021-11-12 17:35:42 +00:00
|
|
|
# Note: Clippy checks are configured in .cargo/config.toml
|
2021-11-11 23:14:38 +00:00
|
|
|
echo "Clippy crosvm workspace"
|
|
|
|
cargo clippy \
|
|
|
|
--workspace \
|
|
|
|
--features all-linux \
|
|
|
|
--all-targets \
|
2021-11-12 17:35:42 +00:00
|
|
|
"$@" -- -Dwarnings
|
2021-10-15 01:56:44 +00:00
|
|
|
|
2021-11-11 23:14:38 +00:00
|
|
|
for crate in common/*; do
|
2022-02-07 19:29:09 +00:00
|
|
|
if [ -d "${crate}" ]; then
|
2021-11-11 23:14:38 +00:00
|
|
|
echo ""
|
|
|
|
echo "Clippy ${crate}"
|
2022-02-04 00:12:23 +00:00
|
|
|
(cd "${crate}" &&
|
|
|
|
cargo clippy --all-targets --all-features "$@" -- -Dwarnings)
|
2021-11-11 23:14:38 +00:00
|
|
|
fi
|
|
|
|
done
|