| 1 | #! /usr/bin/env bash |
| 2 | |
| 3 | # Script to run lint checks. |
| 4 | |
| 5 | set -eu |
| 6 | |
| 7 | # Space-separated list of ignored clippy lints. |
| 8 | IGNORE="similar-names wildcard_imports use_self module_name_repetitions" |
| 9 | |
| 10 | allow="" |
| 11 | for name in $IGNORE; do |
| 12 | allow="$allow -A clippy::$name" |
| 13 | done |
| 14 | |
| 15 | # Check rust code with clippy. |
| 16 | rustup component add clippy |
| 17 | cargo clippy --version |
| 18 | cargo clean |
| 19 | cargo clippy --all-targets --all-features -- -D clippy::all -W clippy::pedantic -W clippy::cargo -W clippy::nursery $allow |
| 20 | |
| 21 | # Check bash scripts with shellcheck. |
| 22 | shellcheck --version || exit 0 |
| 23 | SHELLCHECK_OPTS="-e SC2086" shellcheck ci/*.sh tests/*.sh |
| 24 | |
| 25 | exit 0 |