#!/bin/sh # # SPDX-FileCopyrightText: Peter Pentchev # SPDX-License-Identifier: BSD-2-Clause set -e def_cargo='cargo' usage() { cat <&2 exit 1 ;; esac done shift "$((OPTIND - 1))" # The list of allowed and ignored checks is synced with Rust 1.76. set -x "$cargo" clippy \ --tests \ -- \ -W warnings \ -W future-incompatible \ -W nonstandard-style \ -W rust-2018-compatibility \ -W rust-2018-idioms \ -W rust-2021-compatibility \ -W unused \ -W clippy::restriction \ -A clippy::blanket_clippy_restriction_lints \ -A clippy::std_instead_of_alloc \ -A clippy::std_instead_of_core \ -A clippy::implicit_return \ -A clippy::missing_trait_methods \ -A clippy::mod_module_files \ -A clippy::question_mark_used \ -A clippy::ref_patterns \ -A clippy::semicolon_outside_block \ -A clippy::single_call_fn \ -A clippy::self_named_module_files \ -W clippy::pedantic \ -A clippy::module_name_repetitions \ -W clippy::cargo \ ${run_nursery+-W clippy::nursery} \ "$@"