]> git.lizzy.rs Git - rust.git/blob - ci/base-tests.sh
clippy: fix pedantic warnings and run clippy::pedantic lints on the codebase.
[rust.git] / ci / base-tests.sh
1 # Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
4 #
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
10
11
12 set -ex
13
14 echo "Running clippy base tests"
15
16 PATH=$PATH:./node_modules/.bin
17 if [ "$TRAVIS_OS_NAME" == "linux" ]; then
18   remark -f *.md > /dev/null
19 fi
20 # build clippy in debug mode and run tests
21 cargo build --features debugging
22 cargo test --features debugging
23 cd clippy_lints && cargo test && cd ..
24 cd rustc_tools_util && cargo test && cd ..
25 # check that the lint lists are up-to-date
26 ./util/update_lints.py -c
27
28 CLIPPY="`pwd`/target/debug/cargo-clippy clippy"
29 # run clippy on its own codebase...
30 ${CLIPPY} --all-targets --all-features -- -D clippy::all -D clippy::internal -Dclippy::pedantic
31 # ... and some test directories
32 for dir in clippy_workspace_tests clippy_workspace_tests/src clippy_workspace_tests/subcrate clippy_workspace_tests/subcrate/src clippy_dev rustc_tools_util
33 do
34     cd ${dir}
35     ${CLIPPY} -- -D clippy::all -D clippy::pedantic
36     cd -
37 done
38
39
40 # test --manifest-path
41 ${CLIPPY} --manifest-path=clippy_workspace_tests/Cargo.toml -- -D clippy::all
42 cd clippy_workspace_tests/subcrate && ${CLIPPY} --manifest-path=../Cargo.toml -- -D clippy::all && cd ../..
43 set +x