mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
526d0dad92
TEST=bin/clippy Change-Id: I1cb259f399f9aff2b9b745413f9a28e130688a2b Reviewed-on: https://chromium-review.googlesource.com/1566657 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
70 lines
1.5 KiB
Bash
Executable file
70 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# Run `cargo clippy` on all Rust code in crosvm with a mindful set of lints
|
|
# suppressed.
|
|
|
|
set -euo pipefail
|
|
|
|
# Change into directory of script, which is crosvm/bin.
|
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
|
|
# Jump up to root directory of crosvm repo.
|
|
cd ..
|
|
|
|
SUPPRESS=(
|
|
# To be resolved.
|
|
block_in_if_condition_stmt
|
|
clone_on_copy
|
|
collapsible_if
|
|
const_static_lifetime
|
|
extra_unused_lifetimes
|
|
into_iter_on_array
|
|
let_and_return
|
|
let_unit_value
|
|
match_ref_pats
|
|
needless_return
|
|
option_map_unit_fn
|
|
question_mark
|
|
range_plus_one
|
|
redundant_closure
|
|
redundant_pattern_matching
|
|
single_match
|
|
string_lit_as_bytes
|
|
toplevel_ref_arg
|
|
unit_arg
|
|
unneeded_field_pattern
|
|
unused_unit
|
|
useless_format
|
|
|
|
# To be resolved or suppressed locally.
|
|
cast_ptr_alignment
|
|
|
|
# We don't care about these lints. Okay to remain suppressed globally.
|
|
blacklisted_name
|
|
cast_lossless
|
|
cyclomatic_complexity
|
|
enum_variant_names
|
|
identity_op
|
|
len_without_is_empty
|
|
len_zero
|
|
match_bool
|
|
match_wild_err_arm
|
|
module_inception
|
|
needless_bool
|
|
new_without_default
|
|
or_fun_call
|
|
should_implement_trait
|
|
single_char_pattern
|
|
too_many_arguments
|
|
transmute_ptr_to_ptr
|
|
trivially_copy_pass_by_ref
|
|
type_complexity
|
|
unreadable_literal
|
|
useless_let_if_seq
|
|
useless_transmute
|
|
)
|
|
|
|
# Needed or else clippy won't re-run on code that has already compiled.
|
|
cargo clean
|
|
|
|
cargo clippy --all-features -- ${SUPPRESS[@]/#/-Aclippy::} "$@"
|