3 echo "Running clippy base tests"
5 PATH=$PATH:./node_modules/.bin
6 if [ "$TRAVIS_OS_NAME" == "linux" ]; then
7 remark -f *.md > /dev/null
9 # build clippy in debug mode and run tests
10 cargo build --features debugging
11 cargo test --features debugging
12 # for faster build, share target dir between subcrates
13 export CARGO_TARGET_DIR=`pwd`/target/
14 cd clippy_lints && cargo test && cd ..
15 cd rustc_tools_util && cargo test && cd ..
16 cd clippy_dev && cargo test && cd ..
18 # make sure clippy can be called via ./path/to/cargo-clippy
19 cd clippy_workspace_tests
20 ../target/debug/cargo-clippy
23 # Perform various checks for lint registration
24 ./util/dev update_lints --check
25 cargo +nightly fmt --all -- --check
27 # make sure tests are formatted
29 # some lints are sensitive to formatting, exclude some files
30 tests_need_reformatting="false"
32 rustup override set nightly
33 # avoid loop spam and allow cmds with exit status != 0
36 for file in `find tests -not -path "tests/ui/methods.rs" -not -path "tests/ui/format.rs" -not -path "tests/ui/formatting.rs" -not -path "tests/ui/empty_line_after_outer_attribute.rs" -not -path "tests/ui/double_parens.rs" -not -path "tests/ui/doc.rs" -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
37 rustfmt ${file} --check
39 echo "${file} needs reformatting!"
40 tests_need_reformatting="true"
46 if [ "${tests_need_reformatting}" == "true" ] ; then
47 echo "Tests need reformatting!"
51 # switch back to master
52 rustup override set master